@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @param LoginUserEvent $event |
29 | 29 | * |
30 | - * @return bool |
|
30 | + * @return boolean|null |
|
31 | 31 | */ |
32 | 32 | public function onLogin(LoginUserEvent $event) |
33 | 33 | { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @param LoginUserEvent $event |
39 | 39 | * |
40 | - * @return bool |
|
40 | + * @return boolean|null |
|
41 | 41 | */ |
42 | 42 | public function onLoginSuccess(LoginUserEvent $event) |
43 | 43 | { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @param Event $event |
49 | 49 | * |
50 | - * @return bool |
|
50 | + * @return boolean|null |
|
51 | 51 | */ |
52 | 52 | public function onFoo(Event $event) |
53 | 53 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * @param Event $event |
58 | 58 | * |
59 | - * @return bool |
|
59 | + * @return boolean|null |
|
60 | 60 | */ |
61 | 61 | public function onBar(Event $event) |
62 | 62 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this |
70 | 70 | ->given($dispatcher = $this->createEventDispatcher()) |
71 | 71 | ->then() |
72 | - ->exception(function () use ($dispatcher) { |
|
72 | + ->exception(function() use ($dispatcher) { |
|
73 | 73 | $dispatcher->dispatch(new InvalidEvent()); |
74 | 74 | }) |
75 | 75 | ->isInstanceOf(\InvalidArgumentException::class) |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $this |
80 | 80 | ->given($dispatcher = $this->createEventDispatcher()) |
81 | 81 | ->and($counter = 0) |
82 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
82 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
83 | 83 | ++$counter; |
84 | 84 | })) |
85 | 85 | ->when($dispatcher->dispatch('foo.event')) |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | $this |
93 | 93 | ->given($dispatcher = $this->createEventDispatcher()) |
94 | 94 | ->and($counter = 0) |
95 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
95 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
96 | 96 | ++$counter; |
97 | 97 | })) |
98 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
98 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
99 | 99 | ++$counter; |
100 | 100 | })) |
101 | 101 | ->when($dispatcher->dispatch('foo.event')) |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | $this |
109 | 109 | ->given($dispatcher = $this->createEventDispatcher()) |
110 | 110 | ->and($counter = 0) |
111 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
111 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
112 | 112 | ++$counter; |
113 | 113 | $event->stopPropagation(); |
114 | 114 | })) |
115 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
115 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
116 | 116 | ++$counter; |
117 | 117 | })) |
118 | 118 | ->when($dispatcher->dispatch('foo.event')) |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $this |
126 | 126 | ->given($dispatcher = $this->createEventDispatcher()) |
127 | 127 | ->and($counter = 3) |
128 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
128 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
129 | 129 | $counter = $counter * 5; |
130 | 130 | }, 50)) |
131 | - ->and($dispatcher->addListener('foo.event', function (Event $event) use (&$counter) { |
|
131 | + ->and($dispatcher->addListener('foo.event', function(Event $event) use (&$counter) { |
|
132 | 132 | $counter = $counter + 2; |
133 | 133 | }, 100)) |
134 | 134 | ->when($dispatcher->dispatch('foo.event')) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ->given($dispatcher = $this->createEventDispatcher()) |
143 | 143 | ->and($event = new LoginUserEvent('[email protected]')) |
144 | 144 | ->and($dispatcher->addListener($event->name(), array(new LoginUserEventListener(), 'onLogin'))) |
145 | - ->and($dispatcher->addListener($event->name(), function (LoginUserEvent $event) { |
|
145 | + ->and($dispatcher->addListener($event->name(), function(LoginUserEvent $event) { |
|
146 | 146 | $this |
147 | 147 | ->string($event->email()) |
148 | 148 | ->isEqualTo('[email protected]') |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | $this |
166 | 166 | ->given($dispatcher = $this->createEventDispatcher()) |
167 | 167 | ->and($dispatcher->addListener('event.foo', array(new LoginUserEventListener(), 'onLogin'))) |
168 | - ->and($dispatcher->addListener('event.foo', function (Event $event) { |
|
168 | + ->and($dispatcher->addListener('event.foo', function(Event $event) { |
|
169 | 169 | |
170 | 170 | })) |
171 | - ->and($dispatcher->addListener('event.bar', function (Event $event) { |
|
171 | + ->and($dispatcher->addListener('event.bar', function(Event $event) { |
|
172 | 172 | |
173 | 173 | })) |
174 | 174 | ->when($listeners = $dispatcher->listeners()) |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | $this |
193 | 193 | ->given($dispatcher = $this->createEventDispatcher()) |
194 | 194 | ->and($listener1 = array(new LoginUserEventListener(), 'onLogin')) |
195 | - ->and($listener2 = function (Event $event) { |
|
195 | + ->and($listener2 = function(Event $event) { |
|
196 | 196 | return $event->name(); |
197 | 197 | }) |
198 | - ->and($listener3 = function (Event $event) { |
|
198 | + ->and($listener3 = function(Event $event) { |
|
199 | 199 | |
200 | 200 | }) |
201 | 201 | ->and($dispatcher->addListener('event.foo', $listener1, 100)) |
@@ -221,10 +221,10 @@ discard block |
||
221 | 221 | $this |
222 | 222 | ->given($dispatcher = $this->createEventDispatcher()) |
223 | 223 | ->and($listener1 = array(new LoginUserEventListener(), 'onLogin')) |
224 | - ->and($listener2 = function (Event $event) { |
|
224 | + ->and($listener2 = function(Event $event) { |
|
225 | 225 | return $event->name(); |
226 | 226 | }) |
227 | - ->and($listener3 = function (Event $event) { |
|
227 | + ->and($listener3 = function(Event $event) { |
|
228 | 228 | |
229 | 229 | }) |
230 | 230 | ->and($dispatcher->addListener('event.foo', $listener1, 100)) |
@@ -248,10 +248,10 @@ discard block |
||
248 | 248 | $this |
249 | 249 | ->given($dispatcher = $this->createEventDispatcher()) |
250 | 250 | ->and($listener1 = array(new LoginUserEventListener(), 'onLogin')) |
251 | - ->and($listener2 = function (Event $event) { |
|
251 | + ->and($listener2 = function(Event $event) { |
|
252 | 252 | return $event->name(); |
253 | 253 | }) |
254 | - ->and($listener3 = function (Event $event) { |
|
254 | + ->and($listener3 = function(Event $event) { |
|
255 | 255 | |
256 | 256 | }) |
257 | 257 | ->and($dispatcher->addListener('event.foo', $listener1, 100)) |