@@ -76,7 +76,7 @@ |
||
76 | 76 | */ |
77 | 77 | protected function getDefaultListenerFactory(): callable |
78 | 78 | { |
79 | - return static function (string $className, array $arguments = []) { |
|
79 | + return static function(string $className, array $arguments = []) { |
|
80 | 80 | return new $className($arguments); |
81 | 81 | }; |
82 | 82 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | // Complex data types. |
85 | 85 | [ |
86 | 86 | [ |
87 | - 'callable' => static function () { |
|
87 | + 'callable' => static function() { |
|
88 | 88 | return 'test'; |
89 | 89 | }, |
90 | 90 | 'data' => [ |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $isStopped = []; |
115 | 115 | |
116 | 116 | for ($x = 0; $x < $listenerCount; $x++) { |
117 | - $eventListeners[] = static function (StoppableEventInterface $event) use ($x, $stopIndex) { |
|
117 | + $eventListeners[] = static function(StoppableEventInterface $event) use ($x, $stopIndex) { |
|
118 | 118 | }; |
119 | 119 | |
120 | 120 | if ($x < ($stopIndex + 1)) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $listeners = []; |
166 | 166 | |
167 | 167 | for ($x = 0; $x < $numberOfListeners; $x++) { |
168 | - $listeners[] = static function ($event) use ($x) { |
|
168 | + $listeners[] = static function($event) use ($x) { |
|
169 | 169 | get_class($event); |
170 | 170 | }; |
171 | 171 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | $event = new \stdClass(); |
215 | 215 | $priority = 10; |
216 | - $listener = static function (\stdClass $event): void { |
|
216 | + $listener = static function(\stdClass $event): void { |
|
217 | 217 | echo $event->name; |
218 | 218 | }; |
219 | 219 | |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | $event = new \stdClass(); |
239 | 239 | $priority = 100; |
240 | 240 | $listeners = [ |
241 | - static function (\stdClass $event): void { |
|
241 | + static function(\stdClass $event): void { |
|
242 | 242 | echo $event->name; |
243 | 243 | }, |
244 | - static function (\stdClass $event): void { |
|
244 | + static function(\stdClass $event): void { |
|
245 | 245 | echo $event->name; |
246 | 246 | }, |
247 | 247 | ]; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | // One Listener (with type hint) |
114 | 114 | [ |
115 | 115 | [ |
116 | - static function () { |
|
116 | + static function() { |
|
117 | 117 | return 1; |
118 | 118 | }, |
119 | 119 | ], |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | // Three Listeners |
123 | 123 | [ |
124 | 124 | [ |
125 | - static function () { |
|
125 | + static function() { |
|
126 | 126 | return 0; |
127 | 127 | }, |
128 | - static function () { |
|
128 | + static function() { |
|
129 | 129 | return 1; |
130 | 130 | }, |
131 | - static function () { |
|
131 | + static function() { |
|
132 | 132 | return 2; |
133 | 133 | }, |
134 | 134 | ], |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | // Traversable test |
138 | 138 | [ |
139 | 139 | new ListenerCollection([ |
140 | - static function () { |
|
140 | + static function() { |
|
141 | 141 | return 0; |
142 | 142 | }, |
143 | - static function () { |
|
143 | + static function() { |
|
144 | 144 | return 1; |
145 | 145 | }, |
146 | - static function () { |
|
146 | + static function() { |
|
147 | 147 | return 2; |
148 | 148 | }, |
149 | 149 | ]), |
@@ -222,16 +222,16 @@ discard block |
||
222 | 222 | { |
223 | 223 | return [ |
224 | 224 | [ |
225 | - static function () { |
|
225 | + static function() { |
|
226 | 226 | }, |
227 | 227 | ], |
228 | 228 | [ |
229 | - static function () { |
|
229 | + static function() { |
|
230 | 230 | }, |
231 | 231 | 100, |
232 | 232 | ], |
233 | 233 | [ |
234 | - static function () { |
|
234 | + static function() { |
|
235 | 235 | }, |
236 | 236 | -100, |
237 | 237 | ], |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $className = \stdClass::class; |
38 | 38 | |
39 | - $factory = static function () { |
|
39 | + $factory = static function() { |
|
40 | 40 | return false; // our result is not a callable type. |
41 | 41 | }; |
42 | 42 | |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $expectedEvent = new \stdClass(); |
66 | 66 | $expectedArgs = ['hello' => 'foo']; |
67 | 67 | |
68 | - $mockedListener = function ($passedEvent) use ($expectedEvent) { |
|
68 | + $mockedListener = function($passedEvent) use ($expectedEvent) { |
|
69 | 69 | $this->assertSame($passedEvent, $expectedEvent); |
70 | 70 | }; |
71 | 71 | |
72 | - $factory = function ($className, $arguments) use ($mockedListener, $expectedArgs, $expectedClassName) { |
|
72 | + $factory = function($className, $arguments) use ($mockedListener, $expectedArgs, $expectedClassName) { |
|
73 | 73 | $this->assertSame($expectedClassName, $className); |
74 | 74 | $this->assertSame($expectedArgs, $arguments); |
75 | 75 | return $mockedListener; |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | |
95 | 95 | $expectedEvent = new \stdClass(); |
96 | 96 | |
97 | - $defaultListener = function (object $event) use ($expectedEvent) { |
|
97 | + $defaultListener = function(object $event) use ($expectedEvent) { |
|
98 | 98 | $this->assertSame($expectedEvent, $event); |
99 | 99 | }; |
100 | 100 | |
101 | - $defaultListenerFactory = function ( |
|
101 | + $defaultListenerFactory = function( |
|
102 | 102 | string $className, |
103 | 103 | array $arguments = [] |
104 | 104 | ) use ( |
@@ -57,7 +57,7 @@ |
||
57 | 57 | [300, 1], |
58 | 58 | [2345, 999], |
59 | 59 | [1, 1], |
60 | - [1000,1000], |
|
60 | + [1000, 1000], |
|
61 | 61 | [ |
62 | 62 | [1, 100], |
63 | 63 | [1, 100], |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | $collection = new ListenerCollection(); |
38 | 38 | |
39 | 39 | $listeners = [ |
40 | - 'Foo' => static function () { |
|
40 | + 'Foo' => static function() { |
|
41 | 41 | return 'Foo'; |
42 | 42 | }, |
43 | - 'Bar' => static function () { |
|
43 | + 'Bar' => static function() { |
|
44 | 44 | return 'Bar'; |
45 | 45 | }, |
46 | 46 | ]; |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | |
67 | 67 | /** @var callable[] $listeners */ |
68 | 68 | $listeners = [ |
69 | - static function () { |
|
69 | + static function() { |
|
70 | 70 | }, |
71 | - static function () { |
|
71 | + static function() { |
|
72 | 72 | }, |
73 | - static function () { |
|
73 | + static function() { |
|
74 | 74 | }, |
75 | - static function () { |
|
75 | + static function() { |
|
76 | 76 | }, |
77 | 77 | ]; |
78 | 78 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | ]; |
96 | 96 | |
97 | 97 | $listeners = [ |
98 | - static function () { |
|
98 | + static function() { |
|
99 | 99 | return 'foo'; |
100 | 100 | }, |
101 | - static function () { |
|
101 | + static function() { |
|
102 | 102 | return 'bar'; |
103 | 103 | }, |
104 | - static function () { |
|
104 | + static function() { |
|
105 | 105 | return 'baz'; |
106 | 106 | }, |
107 | 107 | ]; |
@@ -127,28 +127,28 @@ discard block |
||
127 | 127 | public function testListenerPriorities(): void |
128 | 128 | { |
129 | 129 | $listeners = [ |
130 | - static function () { |
|
130 | + static function() { |
|
131 | 131 | return 5; |
132 | 132 | }, |
133 | - static function () { |
|
133 | + static function() { |
|
134 | 134 | return 1; |
135 | 135 | }, |
136 | - static function () { |
|
136 | + static function() { |
|
137 | 137 | return 3; |
138 | 138 | }, |
139 | - static function () { |
|
139 | + static function() { |
|
140 | 140 | return 7; |
141 | 141 | }, |
142 | - static function () { |
|
142 | + static function() { |
|
143 | 143 | return 4; |
144 | 144 | }, |
145 | - static function () { |
|
145 | + static function() { |
|
146 | 146 | return 8; |
147 | 147 | }, |
148 | - static function () { |
|
148 | + static function() { |
|
149 | 149 | return 6; |
150 | 150 | }, |
151 | - static function () { |
|
151 | + static function() { |
|
152 | 152 | return 2; |
153 | 153 | }, |
154 | 154 | ]; |
@@ -182,28 +182,28 @@ discard block |
||
182 | 182 | public function testListenerPrioritiesRespectNaturalOrderWhenPrioritiesAreTheSame(): void |
183 | 183 | { |
184 | 184 | $listeners = [ |
185 | - static function () { |
|
185 | + static function() { |
|
186 | 186 | return 5; |
187 | 187 | }, |
188 | - static function () { |
|
188 | + static function() { |
|
189 | 189 | return 1; |
190 | 190 | }, |
191 | - static function () { |
|
191 | + static function() { |
|
192 | 192 | return 3; |
193 | 193 | }, |
194 | - static function () { |
|
194 | + static function() { |
|
195 | 195 | return 7; |
196 | 196 | }, |
197 | - static function () { |
|
197 | + static function() { |
|
198 | 198 | return 4; |
199 | 199 | }, |
200 | - static function () { |
|
200 | + static function() { |
|
201 | 201 | return 8; |
202 | 202 | }, |
203 | - static function () { |
|
203 | + static function() { |
|
204 | 204 | return 6; |
205 | 205 | }, |
206 | - static function () { |
|
206 | + static function() { |
|
207 | 207 | return 2; |
208 | 208 | }, |
209 | 209 | ]; |