From c65b37d7dd05f5fdec70014f9bd26c62303e5f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 2 Dec 2012 14:12:48 +0100 Subject: [PATCH] Add space between 'function' and '(' --- test/EventManagerTest.php | 20 ++++++++++---------- test/FilterChainTest.php | 10 +++++----- test/StaticEventManagerTest.php | 18 +++++++++--------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/EventManagerTest.php b/test/EventManagerTest.php index 6f3714e..85da4f4 100644 --- a/test/EventManagerTest.php +++ b/test/EventManagerTest.php @@ -277,16 +277,16 @@ public function testAttachAggregateReturnsAttachOfListenerAggregate() public function testCanDetachListenerAggregates() { // setup some other event listeners, to ensure appropriate items are detached - $listenerFooBar1 = $this->events->attach('foo.bar', function() { + $listenerFooBar1 = $this->events->attach('foo.bar', function () { return true; }); - $listenerFooBar2 = $this->events->attach('foo.bar', function() { + $listenerFooBar2 = $this->events->attach('foo.bar', function () { return true; }); - $listenerFooBaz1 = $this->events->attach('foo.baz', function() { + $listenerFooBaz1 = $this->events->attach('foo.baz', function () { return true; }); - $listenerOther = $this->events->attach('other', function() { + $listenerOther = $this->events->attach('other', function () { return true; }); @@ -315,16 +315,16 @@ public function testCanDetachListenerAggregates() public function testCanDetachListenerAggregatesViaDetach() { // setup some other event listeners, to ensure appropriate items are detached - $listenerFooBar1 = $this->events->attach('foo.bar', function() { + $listenerFooBar1 = $this->events->attach('foo.bar', function () { return true; }); - $listenerFooBar2 = $this->events->attach('foo.bar', function() { + $listenerFooBar2 = $this->events->attach('foo.bar', function () { return true; }); - $listenerFooBaz1 = $this->events->attach('foo.baz', function() { + $listenerFooBaz1 = $this->events->attach('foo.baz', function () { return true; }); - $listenerOther = $this->events->attach('other', function() { + $listenerOther = $this->events->attach('other', function () { return true; }); @@ -609,7 +609,7 @@ public function testListenersAttachedWithWildcardAreTriggeredForAllEvents() { $test = new stdClass; $test->events = array(); - $callback = function($e) use ($test) { + $callback = function ($e) use ($test) { $test->events[] = $e->getName(); }; @@ -634,7 +634,7 @@ public function testSharedEventManagerAttachReturnsCallbackHandler() $callbackHandler = $shared->attach( 'foo', 'bar', - function($e) { + function ($e) { return true; } ); diff --git a/test/FilterChainTest.php b/test/FilterChainTest.php index 353b02e..0917eaa 100644 --- a/test/FilterChainTest.php +++ b/test/FilterChainTest.php @@ -74,14 +74,14 @@ public function testRetrievingAttachedFiltersShouldReturnEmptyArrayWhenNoFilters public function testFilterChainShouldReturnLastResponse() { - $this->filterchain->attach(function($context, $params, $chain) { + $this->filterchain->attach(function ($context, $params, $chain) { if (isset($params['string'])) { $params['string'] = trim($params['string']); } $return = $chain->next($context, $params, $chain); return $return; }); - $this->filterchain->attach(function($context, array $params) { + $this->filterchain->attach(function ($context, array $params) { $string = isset($params['string']) ? $params['string'] : ''; return str_rot13($string); }); @@ -107,17 +107,17 @@ public function testInterceptingFilterShouldReceiveChain() public function testFilteringStopsAsSoonAsAFilterFailsToCallNext() { - $this->filterchain->attach(function($context, $params, $chain) { + $this->filterchain->attach(function ($context, $params, $chain) { if (isset($params['string'])) { $params['string'] = trim($params['string']); } return $chain->next($context, $params, $chain); }, 10000); - $this->filterchain->attach(function($context, array $params) { + $this->filterchain->attach(function ($context, array $params) { $string = isset($params['string']) ? $params['string'] : ''; return str_rot13($string); }, 1000); - $this->filterchain->attach(function($context, $params, $chain) { + $this->filterchain->attach(function ($context, $params, $chain) { $string = isset($params['string']) ? $params['string'] : ''; return hash('md5', $string); }, 100); diff --git a/test/StaticEventManagerTest.php b/test/StaticEventManagerTest.php index 56112b4..1a9a3f1 100644 --- a/test/StaticEventManagerTest.php +++ b/test/StaticEventManagerTest.php @@ -144,7 +144,7 @@ public function testListenersAttachedUsingWildcardEventWillBeTriggeredByResource { $test = new stdClass; $test->events = array(); - $callback = function($e) use ($test) { + $callback = function ($e) use ($test) { $test->events[] = $e->getName(); }; @@ -252,10 +252,10 @@ public function testListenersAttachedToAnyIdentifierProvidedToEventManagerWillBe $test = new \stdClass; $test->triggered = 0; - $events->attach('foo', 'bar', function($e) use ($test) { + $events->attach('foo', 'bar', function ($e) use ($test) { $test->triggered++; }); - $events->attach('bar', 'bar', function($e) use ($test) { + $events->attach('bar', 'bar', function ($e) use ($test) { $test->triggered++; }); $manager->trigger('bar', $this, array()); @@ -271,11 +271,11 @@ public function testListenersAttachedToWildcardsWillBeTriggered() $test = new \stdClass; $test->triggered = 0; - $events->attach('*', 'bar', function($e) use ($test) { + $events->attach('*', 'bar', function ($e) use ($test) { $test->triggered++; }); //Tests one can have multiple wildcards attached - $events->attach('*', 'bar', function($e) use ($test) { + $events->attach('*', 'bar', function ($e) use ($test) { $test->triggered++; }); $manager->trigger('bar', $this, array()); @@ -291,17 +291,17 @@ public function testListenersAttachedToAnyIdentifierProvidedToEventManagerOrWild $test = new \stdClass; $test->triggered = 0; - $events->attach('foo', 'bar', function($e) use ($test) { + $events->attach('foo', 'bar', function ($e) use ($test) { $test->triggered++; }); - $events->attach('bar', 'bar', function($e) use ($test) { + $events->attach('bar', 'bar', function ($e) use ($test) { $test->triggered++; }); - $events->attach('*', 'bar', function($e) use ($test) { + $events->attach('*', 'bar', function ($e) use ($test) { $test->triggered++; }); //Tests one can have multiple wildcards attached - $events->attach('*', 'bar', function($e) use ($test) { + $events->attach('*', 'bar', function ($e) use ($test) { $test->triggered++; }); $manager->trigger('bar', $this, array());