@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | use PHPUnit\Framework\TestCase; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | // setup |
31 | 31 | $router = $this->getRouter(); |
32 | - $router->addRoute('/catalog/[i:foo]/', function (): void { |
|
32 | + $router->addRoute('/catalog/[i:foo]/', function(): void { |
|
33 | 33 | // do nothing |
34 | 34 | }); |
35 | 35 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * route |
53 | 53 | * @param string[] $parameters |
54 | 54 | */ |
55 | - function (string $route, array $parameters): string { |
|
55 | + function(string $route, array $parameters): string { |
|
56 | 56 | return $parameters['cat_id']; |
57 | 57 | }); |
58 | 58 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * route |
75 | 75 | * @param string[] $parameters |
76 | 76 | */ |
77 | - function (string $route, array $parameters): string { |
|
77 | + function(string $route, array $parameters): string { |
|
78 | 78 | return $parameters['cat_id'] . $parameters['item_id']; |
79 | 79 | }); |
80 | 80 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | { |
92 | 92 | // setup |
93 | 93 | $router = $this->getRouter(); |
94 | - for ($i = 0; $i < 15; $i ++) { |
|
95 | - $router->addRoute('/multiple/' . $i . '/[i:id]', function () { |
|
94 | + for ($i = 0; $i < 15; $i++) { |
|
95 | + $router->addRoute('/multiple/' . $i . '/[i:id]', function() { |
|
96 | 96 | return 'done!'; |
97 | 97 | }); |
98 | 98 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | /** |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | // setup |
39 | 39 | RouterUnitTestUtils::setRequestMethod('GET'); |
40 | 40 | $router = $this->getRouter(); |
41 | - for ($i = 1; $i <= $amount; $i ++) { |
|
42 | - $router->addRoute('/param/[i:id]/' . $i, function () use ($i): int { |
|
41 | + for ($i = 1; $i <= $amount; $i++) { |
|
42 | + $router->addRoute('/param/[i:id]/' . $i, function() use ($i): int { |
|
43 | 43 | return $i; |
44 | 44 | }); |
45 | 45 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | // assertions |
23 | 23 | $this->expectException(\Exception::class); |
24 | - $this->expectExceptionCode(- 1); |
|
24 | + $this->expectExceptionCode(-1); |
|
25 | 25 | $this->expectErrorMessage('The processor was not found for the route unexisting in GET : r1, ; POST : r1, ; PUT : <none>; DELETE : <none>; OPTION : <none>; PATCH : <none>'); |
26 | 26 | |
27 | 27 | // test body |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | use Mezon\Router\Tests\Utils; |
@@ -54,23 +54,23 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function universalRouteDataProvider(): array |
56 | 56 | { |
57 | - $setup = function (): array { |
|
57 | + $setup = function(): array { |
|
58 | 58 | return [ |
59 | 59 | [ |
60 | 60 | '/hello/[s:name]/', |
61 | - function (): string { |
|
61 | + function(): string { |
|
62 | 62 | return 'hello'; |
63 | 63 | } |
64 | 64 | ], |
65 | 65 | [ |
66 | 66 | '*', |
67 | - function (): string { |
|
67 | + function(): string { |
|
68 | 68 | return 'universal'; |
69 | 69 | } |
70 | 70 | ], |
71 | 71 | [ |
72 | 72 | '/bye/[s:name]/', |
73 | - function (): string { |
|
73 | + function(): string { |
|
74 | 74 | return 'bye'; |
75 | 75 | } |
76 | 76 | ] |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | class RouterUnitTestUtils |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | /** |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | // setup |
61 | 61 | $router = $this->getRouter(); |
62 | - $router->addRoute($route, function () { |
|
62 | + $router->addRoute($route, function() { |
|
63 | 63 | return 'named route result'; |
64 | 64 | }, 'GET', 'named-route'); |
65 | 65 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Base; |
4 | 4 | |
5 | 5 | use Mezon\Router\RouterInterface; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | # 1, lambda |
70 | 70 | [ |
71 | 71 | '/one-component-lambda/', |
72 | - function () { |
|
72 | + function() { |
|
73 | 73 | return 'Hello lambda!'; |
74 | 74 | }, |
75 | 75 | 'Hello lambda!' |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | { |
110 | 110 | $route = '/catalog/'; |
111 | 111 | $router = $this->getRouter(); |
112 | - $router->addRoute($route, function () { |
|
112 | + $router->addRoute($route, function() { |
|
113 | 113 | return 'POST'; |
114 | 114 | }, 'POST'); |
115 | - $router->addRoute($route, function () { |
|
115 | + $router->addRoute($route, function() { |
|
116 | 116 | return 'GET'; |
117 | 117 | }, 'GET'); |
118 | - $router->addRoute($route, function () { |
|
118 | + $router->addRoute($route, function() { |
|
119 | 119 | return 'PUT'; |
120 | 120 | }, 'PUT'); |
121 | - $router->addRoute($route, function () { |
|
121 | + $router->addRoute($route, function() { |
|
122 | 122 | return RouterUnitTestUtils::DELETE_REQUEST_METHOD; |
123 | 123 | }, RouterUnitTestUtils::DELETE_REQUEST_METHOD); |
124 | 124 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | { |
159 | 159 | // setup |
160 | 160 | $router = $this->getRouter(); |
161 | - $router->setNoProcessorFoundErrorHandler(function (): void { |
|
161 | + $router->setNoProcessorFoundErrorHandler(function(): void { |
|
162 | 162 | $this->errorHandler(); |
163 | 163 | }); |
164 | 164 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Mezon\Router\Tests\Simple; |
4 | 4 | |
5 | 5 | use Mezon\Router\RouterInterface; |