@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | class Utilities |
15 | 15 | { |
16 | 16 | /** |
17 | - * @param mixed ...$implementationArgs |
|
18 | - */ |
|
17 | + * @param mixed ...$implementationArgs |
|
18 | + */ |
|
19 | 19 | public static function ObtainFrameworkInstanceMixedArgs( |
20 | 20 | TestCase $testCase, |
21 | 21 | string $implementation, |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | $testCase::assertIsArray($implementationArgs[2] ?? null); |
27 | 27 | |
28 | 28 | /** |
29 | - * @var array{0:string, 1:string, 2:array} |
|
30 | - */ |
|
29 | + * @var array{0:string, 1:string, 2:array} |
|
30 | + */ |
|
31 | 31 | $implementationArgs = $implementationArgs; |
32 | 32 | |
33 | 33 | list($baseUrl, $basePath, $config) = $implementationArgs; |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @param mixed ...$implementationArgs |
|
48 | - */ |
|
47 | + * @param mixed ...$implementationArgs |
|
48 | + */ |
|
49 | 49 | public static function ObtainFrameworkInstance( |
50 | 50 | TestCase $testCase, |
51 | 51 | string $implementation, |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * @var Framework |
|
73 | - */ |
|
72 | + * @var Framework |
|
73 | + */ |
|
74 | 74 | $out = new $implementation($baseUrl, $basePath, $config, ...$implementationArgs); |
75 | 75 | |
76 | 76 | return $out; |
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | - * @param mixed ...$implementationArgs |
|
81 | - */ |
|
80 | + * @param mixed ...$implementationArgs |
|
81 | + */ |
|
82 | 82 | public static function ObtainHttpHandlerInstanceMixedArgs( |
83 | 83 | TestCase $testCase, |
84 | 84 | string $implementation, |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | $testCase::assertIsArray($implementationArgs[2] ?? null); |
90 | 90 | |
91 | 91 | /** |
92 | - * @var array{0:string, 1:string, 2:array} |
|
93 | - */ |
|
92 | + * @var array{0:string, 1:string, 2:array} |
|
93 | + */ |
|
94 | 94 | $implementationArgs = $implementationArgs; |
95 | 95 | |
96 | 96 | list($baseUrl, $basePath, $config) = $implementationArgs; |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | - * @param mixed ...$implementationArgs |
|
111 | - */ |
|
110 | + * @param mixed ...$implementationArgs |
|
111 | + */ |
|
112 | 112 | public static function ObtainHttpHandlerInstance( |
113 | 113 | TestCase $testCase, |
114 | 114 | string $implementation, |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | ); |
129 | 129 | |
130 | 130 | /** |
131 | - * @var HttpHandler |
|
132 | - */ |
|
131 | + * @var HttpHandler |
|
132 | + */ |
|
133 | 133 | $instance = static::ObtainFrameworkInstanceMixedArgs( |
134 | 134 | $testCase, |
135 | 135 | $implementation, |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
146 | - * @param array<string, mixed[]> $postConstructionCalls |
|
147 | - */ |
|
146 | + * @param array<string, mixed[]> $postConstructionCalls |
|
147 | + */ |
|
148 | 148 | public static function ConfigureFrameworkInstance( |
149 | 149 | TestCase $testCase, |
150 | 150 | Framework $instance, |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | class HttpHandlerTest extends Base |
23 | 23 | { |
24 | 24 | /** |
25 | - * @psalm-return Generator<int, array{0:class-string<HttpHandler>, 1:array, 2:string, 3:string, 4:array}, mixed, void> |
|
26 | - */ |
|
25 | + * @psalm-return Generator<int, array{0:class-string<HttpHandler>, 1:array, 2:string, 3:string, 4:array}, mixed, void> |
|
26 | + */ |
|
27 | 27 | public function DataProviderHttpHandlerInstances() : Generator |
28 | 28 | { |
29 | 29 | yield from [ |
@@ -42,29 +42,29 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * @psalm-return Generator<int, array{0:HttpHandler, 1:Request, 2:int, 3:string}, mixed, void> |
|
46 | - */ |
|
45 | + * @psalm-return Generator<int, array{0:HttpHandler, 1:Request, 2:int, 3:string}, mixed, void> |
|
46 | + */ |
|
47 | 47 | public function DataProviderHttpHandlerHandle() : Generator |
48 | 48 | { |
49 | 49 | foreach ($this->DataProviderHttpHandlerInstances() as $args) { |
50 | 50 | /** |
51 | - * @var string |
|
52 | - */ |
|
51 | + * @var string |
|
52 | + */ |
|
53 | 53 | $implementation = $args[0]; |
54 | 54 | |
55 | 55 | /** |
56 | - * @var array<string, mixed[]> |
|
57 | - */ |
|
56 | + * @var array<string, mixed[]> |
|
57 | + */ |
|
58 | 58 | $postConstructionCalls = $args[1]; |
59 | 59 | |
60 | 60 | /** |
61 | - * @var string |
|
62 | - */ |
|
61 | + * @var string |
|
62 | + */ |
|
63 | 63 | $basePath = $args[3]; |
64 | 64 | |
65 | 65 | /** |
66 | - * @var array<string, mixed[]> |
|
67 | - */ |
|
66 | + * @var array<string, mixed[]> |
|
67 | + */ |
|
68 | 68 | $config = $args[4]; |
69 | 69 | |
70 | 70 | foreach ($this->DataProviderVerifyHandlerGood() as $testArgs) { |
@@ -86,23 +86,23 @@ discard block |
||
86 | 86 | $config = (array) $config; |
87 | 87 | |
88 | 88 | /** |
89 | - * @var array |
|
90 | - */ |
|
89 | + * @var array |
|
90 | + */ |
|
91 | 91 | $testArgs = $testArgs; |
92 | 92 | |
93 | 93 | /** |
94 | - * @var int |
|
95 | - */ |
|
94 | + * @var int |
|
95 | + */ |
|
96 | 96 | $expectedStatus = $testArgs[2]; |
97 | 97 | |
98 | 98 | /** |
99 | - * @var string |
|
100 | - */ |
|
99 | + * @var string |
|
100 | + */ |
|
101 | 101 | $expectedContent = $testArgs[3]; |
102 | 102 | |
103 | 103 | /** |
104 | - * @var array |
|
105 | - */ |
|
104 | + * @var array |
|
105 | + */ |
|
106 | 106 | $requestArgs = $testArgs[4]; |
107 | 107 | |
108 | 108 | $instance = Utilities::ObtainHttpHandlerInstanceMixedArgs( |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | $server = (array) ($requestArgs[5] ?? []); |
123 | 123 | |
124 | 124 | /** |
125 | - * @var string|resource|null |
|
126 | - */ |
|
125 | + * @var string|resource|null |
|
126 | + */ |
|
127 | 127 | $content = ($requestArgs[6] ?? null); |
128 | 128 | |
129 | 129 | $request = Request::create( |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * @dataProvider DataProviderHttpHandlerHandle |
|
146 | - */ |
|
145 | + * @dataProvider DataProviderHttpHandlerHandle |
|
146 | + */ |
|
147 | 147 | public function testHandlerGoodOnHttpHandler( |
148 | 148 | HttpHandler $instance, |
149 | 149 | Request $request, |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | - * @psalm-return Generator<int, array{0:class-string<HttpHandler>, 1:string, 2:string, 3:array, 4:array<string, mixed[]>}, mixed, void> |
|
161 | - */ |
|
160 | + * @psalm-return Generator<int, array{0:class-string<HttpHandler>, 1:string, 2:string, 3:array, 4:array<string, mixed[]>}, mixed, void> |
|
161 | + */ |
|
162 | 162 | public function DataProviderTestDroppedConfigProperty() : Generator |
163 | 163 | { |
164 | 164 | foreach ($this->DataProviderHttpHandlerInstances() as $args) { |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | |
173 | 173 | foreach (['cacheFile', 'sources'] as $omitSubProperty) { |
174 | 174 | /** |
175 | - * @var array<string, mixed> |
|
176 | - */ |
|
175 | + * @var array<string, mixed> |
|
176 | + */ |
|
177 | 177 | $modifiedConfig = (array) $config; |
178 | 178 | |
179 | 179 | /** |
180 | - * @var array<string, mixed> |
|
181 | - */ |
|
180 | + * @var array<string, mixed> |
|
181 | + */ |
|
182 | 182 | $modifiedDaftSourceConfig = $modifiedConfig[DaftSource::class]; |
183 | 183 | |
184 | 184 | unset($modifiedDaftSourceConfig[$omitSubProperty]); |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | $modifiedConfig[DaftSource::class] = $modifiedDaftSourceConfig; |
187 | 187 | |
188 | 188 | /** |
189 | - * @var array<string, mixed[]> |
|
190 | - */ |
|
189 | + * @var array<string, mixed[]> |
|
190 | + */ |
|
191 | 191 | $args1 = $args[1]; |
192 | 192 | |
193 | 193 | yield [$implementation, $baseUrl, $basePath, $modifiedConfig, $args1]; |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
200 | - * @param array<string, mixed[]> $args1 |
|
201 | - * |
|
202 | - * @dataProvider DataProviderTestDroppedConfigProperty |
|
203 | - */ |
|
200 | + * @param array<string, mixed[]> $args1 |
|
201 | + * |
|
202 | + * @dataProvider DataProviderTestDroppedConfigProperty |
|
203 | + */ |
|
204 | 204 | public function testDroppedConfigProperty( |
205 | 205 | string $implementation, |
206 | 206 | string $baseUrl, |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
225 | - * @depends testHandlerGoodOnHttpHandler |
|
226 | - * |
|
227 | - * @dataProvider DataProviderHttpHandlerHandle |
|
228 | - */ |
|
225 | + * @depends testHandlerGoodOnHttpHandler |
|
226 | + * |
|
227 | + * @dataProvider DataProviderHttpHandlerHandle |
|
228 | + */ |
|
229 | 229 | public function testHandlerGoodWithHttpKernel( |
230 | 230 | HttpHandler $instance, |
231 | 231 | Request $request, |
@@ -251,8 +251,8 @@ discard block |
||
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
254 | - * @psalm-return array{0:string, 1:array, 2:array} |
|
255 | - */ |
|
254 | + * @psalm-return array{0:string, 1:array, 2:array} |
|
255 | + */ |
|
256 | 256 | protected function prepDataProviderVerifyHandlerGoodArgs( |
257 | 257 | array $config, |
258 | 258 | array $testArgs |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | list($uri) = (array) $requestArgs; |
263 | 263 | |
264 | 264 | /** |
265 | - * @var array |
|
266 | - */ |
|
265 | + * @var array |
|
266 | + */ |
|
267 | 267 | $parsed = parse_url((string) $uri); |
268 | 268 | |
269 | 269 | $baseUrl = (string) ($parsed['scheme'] ?? '') . '://' . (string) ($parsed['host'] ?? ''); |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | $baseUrl .= '/' . (string) $prefix; |
276 | 276 | |
277 | 277 | /** |
278 | - * @var array<string, string|array<int, string>> |
|
279 | - * @var array<int, string> $daftSourceConfig['sources'] |
|
280 | - * @var string $daftSourceConfig['cacheFile'] |
|
281 | - */ |
|
278 | + * @var array<string, string|array<int, string>> |
|
279 | + * @var array<int, string> $daftSourceConfig['sources'] |
|
280 | + * @var string $daftSourceConfig['cacheFile'] |
|
281 | + */ |
|
282 | 282 | $daftSourceConfig = (array) $config[DaftSource::class]; |
283 | 283 | |
284 | 284 | $daftSourceConfig['sources'] = array_filter((array) $sources, 'is_string'); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function DataProviderTestDroppedConfigProperty() : Generator |
163 | 163 | { |
164 | 164 | foreach ($this->DataProviderHttpHandlerInstances() as $args) { |
165 | - list($implementation, , , $basePath, $config) = $args; |
|
165 | + list($implementation,,, $basePath, $config) = $args; |
|
166 | 166 | |
167 | 167 | foreach ($this->DataProviderVerifyHandlerGood() as $testArgs) { |
168 | 168 | list($baseUrl, $config) = $this->prepDataProviderVerifyHandlerGoodArgs( |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | array $config, |
258 | 258 | array $testArgs |
259 | 259 | ) : array { |
260 | - list($sources, $prefix, , , $requestArgs) = $testArgs; |
|
260 | + list($sources, $prefix,,, $requestArgs) = $testArgs; |
|
261 | 261 | |
262 | 262 | list($uri) = (array) $requestArgs; |
263 | 263 |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | public function tearDown() : void |
23 | 23 | { |
24 | 24 | /** |
25 | - * @var string[] |
|
26 | - */ |
|
25 | + * @var string[] |
|
26 | + */ |
|
27 | 27 | $strings = array_filter( |
28 | 28 | [ |
29 | 29 | realpath(__DIR__ . '/fixtures/http-kernel.fast-route.cache'), |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * @psalm-return Generator<int, array{0:class-string<Framework>, 1:array<string, array<int, mixed>>, 2:string, 3:string, 4:array}, mixed, void> |
|
46 | - */ |
|
45 | + * @psalm-return Generator<int, array{0:class-string<Framework>, 1:array<string, array<int, mixed>>, 2:string, 3:string, 4:array}, mixed, void> |
|
46 | + */ |
|
47 | 47 | public function DataProviderGoodSources() : Generator |
48 | 48 | { |
49 | 49 | yield from [ |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
142 | - * @psalm-return Generator<int, array{0:class-string<Framework>, 1:class-string<Throwable>, 2:string, 3:int|null, 4:array<string, array<int, mixed>>, 5:string, 6:string, 7:array}, mixed, void> |
|
143 | - */ |
|
142 | + * @psalm-return Generator<int, array{0:class-string<Framework>, 1:class-string<Throwable>, 2:string, 3:int|null, 4:array<string, array<int, mixed>>, 5:string, 6:string, 7:array}, mixed, void> |
|
143 | + */ |
|
144 | 144 | public function DataProviderBadSources() : Generator |
145 | 145 | { |
146 | 146 | yield from [ |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
240 | - * @psalm-return Generator<int, array{0:class-string<Framework>, 1:array<string, array<int, mixed>>, 2:string, 3:string, 4:array}, mixed, void> |
|
241 | - */ |
|
240 | + * @psalm-return Generator<int, array{0:class-string<Framework>, 1:array<string, array<int, mixed>>, 2:string, 3:string, 4:array}, mixed, void> |
|
241 | + */ |
|
242 | 242 | public function DataProviderGoodSourcesSansDatabaseConnection() : Generator |
243 | 243 | { |
244 | 244 | foreach ($this->DataProviderGoodSources() as $args) { |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | /** |
252 | - * @psalm-return Generator<int, array{0:class-string<Framework>, 1:array<string, array<int, mixed>>, 2:string, 3:string, 4:array}, mixed, void> |
|
253 | - */ |
|
252 | + * @psalm-return Generator<int, array{0:class-string<Framework>, 1:array<string, array<int, mixed>>, 2:string, 3:string, 4:array}, mixed, void> |
|
253 | + */ |
|
254 | 254 | public function DataProviderGoodSourcesWithDatabaseConnection() : Generator |
255 | 255 | { |
256 | 256 | foreach ($this->DataProviderGoodSources() as $args) { |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
264 | - * @param array<string, array<int, mixed>> $postConstructionCalls |
|
265 | - * @param mixed ...$implementationArgs |
|
266 | - * |
|
267 | - * @dataProvider DataProviderGoodSources |
|
268 | - */ |
|
264 | + * @param array<string, array<int, mixed>> $postConstructionCalls |
|
265 | + * @param mixed ...$implementationArgs |
|
266 | + * |
|
267 | + * @dataProvider DataProviderGoodSources |
|
268 | + */ |
|
269 | 269 | public function testEverythingInitialisesFine( |
270 | 270 | string $implementation, |
271 | 271 | array $postConstructionCalls, |
@@ -286,15 +286,15 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
289 | - * @param class-string<Framework> $implementation |
|
290 | - * @param class-string<Throwable> $expectedExceptionClass |
|
291 | - * @param array<string, array<int, mixed>> $postConstructionCalls |
|
292 | - * @param mixed ...$implementationArgs |
|
293 | - * |
|
294 | - * @dataProvider DataProviderBadSources |
|
295 | - * |
|
296 | - * @depends testEverythingInitialisesFine |
|
297 | - */ |
|
289 | + * @param class-string<Framework> $implementation |
|
290 | + * @param class-string<Throwable> $expectedExceptionClass |
|
291 | + * @param array<string, array<int, mixed>> $postConstructionCalls |
|
292 | + * @param mixed ...$implementationArgs |
|
293 | + * |
|
294 | + * @dataProvider DataProviderBadSources |
|
295 | + * |
|
296 | + * @depends testEverythingInitialisesFine |
|
297 | + */ |
|
298 | 298 | public function testThingsFail( |
299 | 299 | string $implementation, |
300 | 300 | string $expectedExceptionClass, |
@@ -325,13 +325,13 @@ discard block |
||
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
328 | - * @param array<string, array<int, mixed>> $postConstructionCalls |
|
329 | - * @param mixed ...$implementationArgs |
|
330 | - * |
|
331 | - * @dataProvider DataProviderGoodSourcesSansDatabaseConnection |
|
332 | - * |
|
333 | - * @depends testEverythingInitialisesFine |
|
334 | - */ |
|
328 | + * @param array<string, array<int, mixed>> $postConstructionCalls |
|
329 | + * @param mixed ...$implementationArgs |
|
330 | + * |
|
331 | + * @dataProvider DataProviderGoodSourcesSansDatabaseConnection |
|
332 | + * |
|
333 | + * @depends testEverythingInitialisesFine |
|
334 | + */ |
|
335 | 335 | public function testGoodSourcesSansDatabaseConnection( |
336 | 336 | string $implementation, |
337 | 337 | array $postConstructionCalls, |
@@ -347,13 +347,13 @@ discard block |
||
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
350 | - * @param array<string, array<int, mixed>> $postConstructionCalls |
|
351 | - * @param mixed ...$implementationArgs |
|
352 | - * |
|
353 | - * @dataProvider DataProviderGoodSourcesWithDatabaseConnection |
|
354 | - * |
|
355 | - * @depends testEverythingInitialisesFine |
|
356 | - */ |
|
350 | + * @param array<string, array<int, mixed>> $postConstructionCalls |
|
351 | + * @param mixed ...$implementationArgs |
|
352 | + * |
|
353 | + * @dataProvider DataProviderGoodSourcesWithDatabaseConnection |
|
354 | + * |
|
355 | + * @depends testEverythingInitialisesFine |
|
356 | + */ |
|
357 | 357 | public function testGoodSourcesWithDatabaseConnection( |
358 | 358 | string $implementation, |
359 | 359 | array $postConstructionCalls, |
@@ -368,12 +368,12 @@ discard block |
||
368 | 368 | $this->expectExceptionMessage('Database Connection already made!'); |
369 | 369 | |
370 | 370 | /** |
371 | - * @var array<int, string|array|null> |
|
372 | - * @var string $configureArgs[0] |
|
373 | - * @var string|null $configureArgs[1] |
|
374 | - * @var string|null $configureArgs[2] |
|
375 | - * @var array $configureArgs[3] |
|
376 | - */ |
|
371 | + * @var array<int, string|array|null> |
|
372 | + * @var string $configureArgs[0] |
|
373 | + * @var string|null $configureArgs[1] |
|
374 | + * @var string|null $configureArgs[2] |
|
375 | + * @var array $configureArgs[3] |
|
376 | + */ |
|
377 | 377 | $configureArgs = $postConstructionCalls['ConfigureDatabaseConnection']; |
378 | 378 | |
379 | 379 | $instance->ConfigureDatabaseConnection( |
@@ -385,10 +385,10 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
388 | - * @dataProvider DataProviderGoodSources |
|
389 | - * |
|
390 | - * @depends testEverythingInitialisesFine |
|
391 | - */ |
|
388 | + * @dataProvider DataProviderGoodSources |
|
389 | + * |
|
390 | + * @depends testEverythingInitialisesFine |
|
391 | + */ |
|
392 | 392 | public function testUnpairedFrameworksFail(string $implementation) : void |
393 | 393 | { |
394 | 394 | if ( ! is_a($implementation, Framework::class, true)) { |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | /** |
411 | - * @param array<string, array<int, mixed>> $postConstructionCalls |
|
412 | - * @param mixed ...$implementationArgs |
|
413 | - * |
|
414 | - * @dataProvider DataProviderGoodSources |
|
415 | - * |
|
416 | - * @depends testEverythingInitialisesFine |
|
417 | - * @depends testUnpairedFrameworksFail |
|
418 | - */ |
|
411 | + * @param array<string, array<int, mixed>> $postConstructionCalls |
|
412 | + * @param mixed ...$implementationArgs |
|
413 | + * |
|
414 | + * @dataProvider DataProviderGoodSources |
|
415 | + * |
|
416 | + * @depends testEverythingInitialisesFine |
|
417 | + * @depends testUnpairedFrameworksFail |
|
418 | + */ |
|
419 | 419 | public function testDisposeOfFrameworkReferences( |
420 | 420 | string $implementation, |
421 | 421 | array $postConstructionCalls, |
@@ -449,14 +449,14 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | /** |
452 | - * @param array<string, array<int, mixed>> $postConstructionCalls |
|
453 | - * @param mixed ...$implementationArgs |
|
454 | - * |
|
455 | - * @dataProvider DataProviderGoodSources |
|
456 | - * |
|
457 | - * @depends testEverythingInitialisesFine |
|
458 | - * @depends testUnpairedFrameworksFail |
|
459 | - */ |
|
452 | + * @param array<string, array<int, mixed>> $postConstructionCalls |
|
453 | + * @param mixed ...$implementationArgs |
|
454 | + * |
|
455 | + * @dataProvider DataProviderGoodSources |
|
456 | + * |
|
457 | + * @depends testEverythingInitialisesFine |
|
458 | + * @depends testUnpairedFrameworksFail |
|
459 | + */ |
|
460 | 460 | public function testDisposeOfRequestReferences( |
461 | 461 | string $implementation, |
462 | 462 | array $postConstructionCalls, |
@@ -496,8 +496,8 @@ discard block |
||
496 | 496 | } |
497 | 497 | |
498 | 498 | /** |
499 | - * @dataProvider DataProviderGoodSources |
|
500 | - */ |
|
499 | + * @dataProvider DataProviderGoodSources |
|
500 | + */ |
|
501 | 501 | public function testNormaliseUrlFails(string $implementation) : void |
502 | 502 | { |
503 | 503 | if ( ! is_a($implementation, Framework::class, true)) { |
@@ -525,11 +525,11 @@ discard block |
||
525 | 525 | } |
526 | 526 | |
527 | 527 | /** |
528 | - * @param array<string, mixed[]> $postConstructionCalls |
|
529 | - * @param mixed ...$implementationArgs |
|
530 | - * |
|
531 | - * @psalm-return array{0:Framework, 1:Request, 2:Request} |
|
532 | - */ |
|
528 | + * @param array<string, mixed[]> $postConstructionCalls |
|
529 | + * @param mixed ...$implementationArgs |
|
530 | + * |
|
531 | + * @psalm-return array{0:Framework, 1:Request, 2:Request} |
|
532 | + */ |
|
533 | 533 | protected function PrepareReferenceDisposalTest( |
534 | 534 | string $implementation, |
535 | 535 | array $postConstructionCalls, |
@@ -559,8 +559,8 @@ discard block |
||
559 | 559 | } |
560 | 560 | |
561 | 561 | /** |
562 | - * @param mixed ...$implementationArgs |
|
563 | - */ |
|
562 | + * @param mixed ...$implementationArgs |
|
563 | + */ |
|
564 | 564 | protected function ObtainFrameworkInstance(string $implementation, ...$implementationArgs) : Framework |
565 | 565 | { |
566 | 566 | return Utilities::ObtainFrameworkInstanceMixedArgs( |
@@ -571,8 +571,8 @@ discard block |
||
571 | 571 | } |
572 | 572 | |
573 | 573 | /** |
574 | - * @param array<string, mixed[]> $postConstructionCalls |
|
575 | - */ |
|
574 | + * @param array<string, mixed[]> $postConstructionCalls |
|
575 | + */ |
|
576 | 576 | protected function ConfigureFrameworkInstance( |
577 | 577 | Framework $instance, |
578 | 578 | array $postConstructionCalls |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | use DaftRouterHttpRouteDefaultMethodGet; |
26 | 26 | |
27 | 27 | /** |
28 | - * @param T2 $args |
|
29 | - */ |
|
28 | + * @param T2 $args |
|
29 | + */ |
|
30 | 30 | public static function DaftRouterHandleRequestWithTypedArgs(Request $request, TypedArgs $args) : Response |
31 | 31 | { |
32 | 32 | static::DaftRouterAutoMethodChecking($request->getMethod()); |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * @param T2 $args |
|
62 | - * @param 'GET'|null $method |
|
63 | - */ |
|
61 | + * @param T2 $args |
|
62 | + * @param 'GET'|null $method |
|
63 | + */ |
|
64 | 64 | public static function DaftRouterHttpRouteWithTypedArgs( |
65 | 65 | TypedArgs $args, |
66 | 66 | string $method = null |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | - * @param T3 $args |
|
80 | - * @param 'GET'|null $method |
|
81 | - * |
|
82 | - * @return T2 |
|
83 | - */ |
|
79 | + * @param T3 $args |
|
80 | + * @param 'GET'|null $method |
|
81 | + * |
|
82 | + * @return T2 |
|
83 | + */ |
|
84 | 84 | public static function DaftRouterHttpRouteArgsTyped(array $args, string $method = null) |
85 | 85 | { |
86 | 86 | return new CookieTestArgs($args); |
@@ -21,36 +21,36 @@ |
||
21 | 21 | class CookieTestArgs extends TypedArgs |
22 | 22 | { |
23 | 23 | /** |
24 | - * @var T |
|
25 | - */ |
|
24 | + * @var T |
|
25 | + */ |
|
26 | 26 | protected $typed; |
27 | 27 | |
28 | 28 | /** |
29 | - * @template K as 'name'|'value'|'secure'|'http'|'same-site' |
|
30 | - * |
|
31 | - * @param array{name:string, value:string, secure:'0'|'1', http:'0'|'1', same-site:'lax'|'strict'} $args |
|
32 | - */ |
|
29 | + * @template K as 'name'|'value'|'secure'|'http'|'same-site' |
|
30 | + * |
|
31 | + * @param array{name:string, value:string, secure:'0'|'1', http:'0'|'1', same-site:'lax'|'strict'} $args |
|
32 | + */ |
|
33 | 33 | public function __construct(array $args) |
34 | 34 | { |
35 | 35 | $args['secure'] = (bool) $args['secure']; |
36 | 36 | $args['http'] = (bool) $args['http']; |
37 | 37 | |
38 | 38 | /** |
39 | - * @var T |
|
40 | - */ |
|
39 | + * @var T |
|
40 | + */ |
|
41 | 41 | $args = $args; |
42 | 42 | |
43 | 43 | $this->typed = $args; |
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @return 'lax'|'strict' |
|
48 | - */ |
|
47 | + * @return 'lax'|'strict' |
|
48 | + */ |
|
49 | 49 | public function SameSite() : string |
50 | 50 | { |
51 | 51 | /** |
52 | - * @var 'lax'|'strict' |
|
53 | - */ |
|
52 | + * @var 'lax'|'strict' |
|
53 | + */ |
|
54 | 54 | $out = $this->__get('same-site'); |
55 | 55 | |
56 | 56 | return $out; |
@@ -11,8 +11,8 @@ |
||
11 | 11 | class ExecuteCoverageCommand extends FastRouteCacheCommand |
12 | 12 | { |
13 | 13 | /** |
14 | - * @var string |
|
15 | - */ |
|
14 | + * @var string |
|
15 | + */ |
|
16 | 16 | protected static $defaultName = 'test:execute-coverage'; |
17 | 17 | |
18 | 18 | protected static function tempnam() : string |
@@ -11,8 +11,8 @@ |
||
11 | 11 | class DisabledTestCommand extends Command |
12 | 12 | { |
13 | 13 | /** |
14 | - * @var string |
|
15 | - */ |
|
14 | + * @var string |
|
15 | + */ |
|
16 | 16 | protected static $defaultName = 'test:disabled'; |
17 | 17 | |
18 | 18 | public function isEnabled() : bool |
@@ -11,7 +11,7 @@ |
||
11 | 11 | class TestCommand extends Command |
12 | 12 | { |
13 | 13 | /** |
14 | - * @var string |
|
15 | - */ |
|
14 | + * @var string |
|
15 | + */ |
|
16 | 16 | protected static $defaultName = 'test'; |
17 | 17 | } |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | const NUM_EXPECTED_ARGS = 6; |
31 | 31 | |
32 | 32 | /** |
33 | - * @psalm-return Generator<int, array{0:string, 1:string, 2:array<int, class-string>, 3:class-string<Framework>, 4:array}, mixed, void> |
|
34 | - */ |
|
33 | + * @psalm-return Generator<int, array{0:string, 1:string, 2:array<int, class-string>, 3:class-string<Framework>, 4:array}, mixed, void> |
|
34 | + */ |
|
35 | 35 | final public function DataProviderConsoleApplicationConfigFiltered() : Generator |
36 | 36 | { |
37 | 37 | foreach ($this->DataProviderConsoleApplicationConfig() as $args) { |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | $args[$key] = $appendTo; |
49 | 49 | |
50 | 50 | /** |
51 | - * @psalm-var array{0:string, 1:string, 2:array<int, class-string>, 3:class-string<Framework>, 4:array} |
|
52 | - */ |
|
51 | + * @psalm-var array{0:string, 1:string, 2:array<int, class-string>, 3:class-string<Framework>, 4:array} |
|
52 | + */ |
|
53 | 53 | $args = $args; |
54 | 54 | |
55 | 55 | yield $args; |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | - * @psalm-return Generator<int, array{0:Framework, 1:Command}, mixed, void> |
|
62 | - */ |
|
61 | + * @psalm-return Generator<int, array{0:Framework, 1:Command}, mixed, void> |
|
62 | + */ |
|
63 | 63 | final public function DataProviderDaftConsoleCommands() : Generator |
64 | 64 | { |
65 | 65 | foreach ($this->DataProviderConsoleApplicationConfigFiltered() as $args) { |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | ); |
77 | 77 | |
78 | 78 | /** |
79 | - * @var scalar[] |
|
80 | - */ |
|
79 | + * @var scalar[] |
|
80 | + */ |
|
81 | 81 | $maybeCommandSources = ($args[2] ?? []); |
82 | 82 | |
83 | 83 | foreach ($maybeCommandSources as $maybeCommand) { |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * @var Command |
|
99 | - */ |
|
98 | + * @var Command |
|
99 | + */ |
|
100 | 100 | $command = new $maybeCommand($maybeCommand::getDefaultName()); |
101 | 101 | |
102 | 102 | yield [$framework, $command]; |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * @param array<int, string> $expectedCommandInstances |
|
110 | - * |
|
111 | - * @psalm-param array<int, class-string> $expectedCommandInstances |
|
112 | - * |
|
113 | - * @dataProvider DataProviderConsoleApplicationConfigFiltered |
|
114 | - */ |
|
109 | + * @param array<int, string> $expectedCommandInstances |
|
110 | + * |
|
111 | + * @psalm-param array<int, class-string> $expectedCommandInstances |
|
112 | + * |
|
113 | + * @dataProvider DataProviderConsoleApplicationConfigFiltered |
|
114 | + */ |
|
115 | 115 | public function testApplicationSetup( |
116 | 116 | string $name, |
117 | 117 | string $version, |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
180 | - * @var BaseCommand |
|
181 | - */ |
|
180 | + * @var BaseCommand |
|
181 | + */ |
|
182 | 182 | $command = new $expectedComamnd($expectedComamnd::getDefaultName()); |
183 | 183 | |
184 | 184 | $this->expectException(BadMethodCallException::class); |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
194 | - * @param array<int, string> $expectedCommandInstances |
|
195 | - * |
|
196 | - * @psalm-param array<int, class-string> $expectedCommandInstances |
|
197 | - * |
|
198 | - * @dataProvider DataProviderConsoleApplicationConfigFiltered |
|
199 | - * |
|
200 | - * @depends testApplicationSetup |
|
201 | - */ |
|
194 | + * @param array<int, string> $expectedCommandInstances |
|
195 | + * |
|
196 | + * @psalm-param array<int, class-string> $expectedCommandInstances |
|
197 | + * |
|
198 | + * @dataProvider DataProviderConsoleApplicationConfigFiltered |
|
199 | + * |
|
200 | + * @depends testApplicationSetup |
|
201 | + */ |
|
202 | 202 | public function testCommandCollectionWithoutFramework( |
203 | 203 | string $name, |
204 | 204 | string $version, |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
218 | - * @dataProvider DataProviderDaftConsoleCommands |
|
219 | - * |
|
220 | - * @depends testApplicationSetup |
|
221 | - */ |
|
218 | + * @dataProvider DataProviderDaftConsoleCommands |
|
219 | + * |
|
220 | + * @depends testApplicationSetup |
|
221 | + */ |
|
222 | 222 | public function testCommandFrameworkAttachment(Framework $framework, Command $command) : void |
223 | 223 | { |
224 | 224 | static::assertFalse($command->CheckIfUsingFrameworkInstance($framework)); |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * @psalm-return Generator<int, array{0:Application, 1:string}, mixed, void> |
|
248 | - */ |
|
247 | + * @psalm-return Generator<int, array{0:Application, 1:string}, mixed, void> |
|
248 | + */ |
|
249 | 249 | public function DataProviderFastRouteCacheComamnd() : Generator |
250 | 250 | { |
251 | 251 | $expectedOutput = file_get_contents( |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | |
256 | 256 | foreach ($this->DataProviderConsoleApplicationConfigFiltered() as $i => $args) { |
257 | 257 | /** |
258 | - * @var string |
|
259 | - */ |
|
258 | + * @var string |
|
259 | + */ |
|
260 | 260 | $frameworkImplementation = $args[3]; |
261 | 261 | |
262 | 262 | if ( ! is_a($frameworkImplementation, Framework::class, true)) { |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
274 | - * @var array<string, array> |
|
275 | - */ |
|
274 | + * @var array<string, array> |
|
275 | + */ |
|
276 | 276 | $args42 = (array) ((array) $args[4])[2] ?? []; |
277 | 277 | $args42[DaftConsoleSource::class][] = FastRouteCacheCommand::class; |
278 | 278 | $args42[DaftSource::class]['sources'] = [Config::class]; |
@@ -298,8 +298,8 @@ discard block |
||
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
301 | - * @dataProvider DataProviderFastRouteCacheComamnd |
|
302 | - */ |
|
301 | + * @dataProvider DataProviderFastRouteCacheComamnd |
|
302 | + */ |
|
303 | 303 | public function testFastRouteCacheCommand( |
304 | 304 | Application $application, |
305 | 305 | string $expectedOutput |
@@ -365,8 +365,8 @@ discard block |
||
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
368 | - * @dataProvider DataProviderFastRouteCacheComamnd |
|
369 | - */ |
|
368 | + * @dataProvider DataProviderFastRouteCacheComamnd |
|
369 | + */ |
|
370 | 370 | public function testExecuteCoverageCommand(Application $application) : void |
371 | 371 | { |
372 | 372 | $command = $application->find('test:execute-coverage'); |
@@ -394,8 +394,8 @@ discard block |
||
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
397 | - * @psalm-return Generator<int, array{0:string, 1:string, 2:string, 3:array<int, class-string>, 4:class-string<Framework>, 5:array}, mixed, void> |
|
398 | - */ |
|
397 | + * @psalm-return Generator<int, array{0:string, 1:string, 2:string, 3:array<int, class-string>, 4:class-string<Framework>, 5:array}, mixed, void> |
|
398 | + */ |
|
399 | 399 | protected function DataProviderConsoleApplicationConfig() : Generator |
400 | 400 | { |
401 | 401 | yield from [ |
@@ -329,7 +329,7 @@ |
||
329 | 329 | ], |
330 | 330 | ], |
331 | 331 | array_map( |
332 | - function (InputArgument $arg) : array { |
|
332 | + function(InputArgument $arg) : array { |
|
333 | 333 | return [ |
334 | 334 | 'name' => $arg->getName(), |
335 | 335 | 'required' => $arg->isRequired(), |