@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | /** |
| 29 | 29 | * @param LoginUserEvent $event |
| 30 | 30 | * |
| 31 | - * @return bool |
|
| 31 | + * @return boolean|null |
|
| 32 | 32 | */ |
| 33 | 33 | public function onLogin(LoginUserEvent $event) |
| 34 | 34 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * @param LoginUserEvent $event |
| 40 | 40 | * |
| 41 | - * @return bool |
|
| 41 | + * @return boolean|null |
|
| 42 | 42 | */ |
| 43 | 43 | public function onLoginSuccess(LoginUserEvent $event) |
| 44 | 44 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * @param Event $event |
| 50 | 50 | * |
| 51 | - * @return bool |
|
| 51 | + * @return boolean|null |
|
| 52 | 52 | */ |
| 53 | 53 | public function onFoo(Event $event) |
| 54 | 54 | { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * @param Event $event |
| 59 | 59 | * |
| 60 | - * @return bool |
|
| 60 | + * @return boolean|null |
|
| 61 | 61 | */ |
| 62 | 62 | public function onBar(Event $event) |
| 63 | 63 | { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ->given($middleware = new LockingMiddleware()) |
| 38 | 38 | ->and($eventBus = new EventBus([$middleware])) |
| 39 | 39 | ->then() |
| 40 | - ->exception(function () use ($eventBus) { |
|
| 40 | + ->exception(function() use ($eventBus) { |
|
| 41 | 41 | $eventBus->dispatch(new LoginUserEvent('[email protected]')); |
| 42 | 42 | }) |
| 43 | 43 | ->isInstanceOf(NotFoundException::class) |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $this |
| 53 | 53 | ->given($eventBus = EventBus::create()) |
| 54 | 54 | ->and($event = new LoginUserEvent('[email protected]')) |
| 55 | - ->and($eventBus->addListener($event->eventName(), function (LoginUserEvent $event) { |
|
| 55 | + ->and($eventBus->addListener($event->eventName(), function(LoginUserEvent $event) { |
|
| 56 | 56 | $this |
| 57 | 57 | ->string($event->email()) |
| 58 | 58 | ->isEqualTo('[email protected]') |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $this |
| 76 | 76 | ->given($eventBus = EventBus::create()) |
| 77 | 77 | ->then() |
| 78 | - ->exception(function () use ($eventBus) { |
|
| 78 | + ->exception(function() use ($eventBus) { |
|
| 79 | 79 | $eventBus->dispatch(new FooMessage()); |
| 80 | 80 | }) |
| 81 | 81 | ->isInstanceOf(\InvalidArgumentException::class) |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | $this |
| 105 | 105 | ->given($eventBus = EventBus::create()) |
| 106 | 106 | ->and($eventBus->addListener('event.foo', array(new LoginUserEventListener(), 'loginUser'))) |
| 107 | - ->and($eventBus->addListener('event.foo', function (Event $event) { |
|
| 107 | + ->and($eventBus->addListener('event.foo', function(Event $event) { |
|
| 108 | 108 | |
| 109 | 109 | })) |
| 110 | - ->and($eventBus->addListener('event.bar', function (Event $event) { |
|
| 110 | + ->and($eventBus->addListener('event.bar', function(Event $event) { |
|
| 111 | 111 | |
| 112 | 112 | })) |
| 113 | 113 | ->when($listeners = $eventBus->listeners()) |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | $this |
| 132 | 132 | ->given($eventBus = EventBus::create()) |
| 133 | 133 | ->and($listener1 = array(new LoginUserEventListener(), 'loginUser')) |
| 134 | - ->and($listener2 = function (Event $event) { |
|
| 134 | + ->and($listener2 = function(Event $event) { |
|
| 135 | 135 | return $event->eventName(); |
| 136 | 136 | }) |
| 137 | - ->and($listener3 = function (Event $event) { |
|
| 137 | + ->and($listener3 = function(Event $event) { |
|
| 138 | 138 | |
| 139 | 139 | }) |
| 140 | 140 | ->and($eventBus->addListener('event.foo', $listener1, 100)) |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ->and($middleware = new EventDispatcherMiddleware($dispatcher)) |
| 35 | 35 | ->and($event = new LoginUserEvent('[email protected]')) |
| 36 | 36 | ->and($dispatcher->addListener($event->eventName(), array(new LoginUserEventListener(), 'loginUser'))) |
| 37 | - ->and($dispatcher->addListener($event->eventName(), function (LoginUserEvent $event) { |
|
| 37 | + ->and($dispatcher->addListener($event->eventName(), function(LoginUserEvent $event) { |
|
| 38 | 38 | $this |
| 39 | 39 | ->string($event->email()) |
| 40 | 40 | ->isEqualTo('[email protected]') |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $event->setEmail('[email protected]'); |
| 44 | 44 | })) |
| 45 | - ->and($callable = function (LoginUserEvent $event) { |
|
| 45 | + ->and($callable = function(LoginUserEvent $event) { |
|
| 46 | 46 | $event->setEmail('[email protected]'); |
| 47 | 47 | }) |
| 48 | 48 | ->when($result = $middleware->handle($event, $callable)) |
| 49 | 49 | ->then() |
| 50 | 50 | ->string($event->email()) |
| 51 | 51 | ->isEqualTo('[email protected]') |
| 52 | - ->exception(function () use ($middleware, $callable) { |
|
| 52 | + ->exception(function() use ($middleware, $callable) { |
|
| 53 | 53 | $middleware->handle(new \StdClass(), $callable); |
| 54 | 54 | })->isInstanceOf(\InvalidArgumentException::class) |
| 55 | 55 | ; |