@@ -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; |
@@ -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 PHPUnit\Framework\TestCase; |
@@ -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\Simple; |
| 4 | 4 | |
| 5 | 5 | use PHPUnit\Framework\TestCase; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | // setup |
| 51 | 51 | RouterUnitTestUtils::setRequestMethod('GET'); |
| 52 | 52 | $router = new SimpleRouter(); |
| 53 | - $router->addRoute($route, function () { |
|
| 53 | + $router->addRoute($route, function() { |
|
| 54 | 54 | return 'route result'; |
| 55 | 55 | }); |
| 56 | 56 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | // setup |
| 74 | 74 | $router = new SimpleRouter(); |
| 75 | - $router->addRoute('existing-route', function () { |
|
| 75 | + $router->addRoute('existing-route', function() { |
|
| 76 | 76 | return 'existing route result'; |
| 77 | 77 | }); |
| 78 | 78 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router; |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | $requestMethod . ' : ' |
| 103 | 103 | ]; |
| 104 | 104 | $hasRoutes = false; |
| 105 | - if (! empty($this->staticRoutes[$requestMethod])) { |
|
| 105 | + if (!empty($this->staticRoutes[$requestMethod])) { |
|
| 106 | 106 | $trace[] = implode(', ', array_keys($this->staticRoutes[$requestMethod])); |
| 107 | 107 | $trace[] = ', '; |
| 108 | 108 | $hasRoutes = true; |
| 109 | 109 | } |
| 110 | - if (! empty($this->paramRoutes[$requestMethod])) { |
|
| 110 | + if (!empty($this->paramRoutes[$requestMethod])) { |
|
| 111 | 111 | $items = []; |
| 112 | 112 | foreach ($this->paramRoutes[$requestMethod] as $item) { |
| 113 | 113 | $items[] = $item['pattern']; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if (! $hasRoutes) { |
|
| 119 | + if (!$hasRoutes) { |
|
| 120 | 120 | $trace[] = '<none>'; |
| 121 | 121 | } |
| 122 | 122 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router; |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $requestMethod = (string) $_SERVER['REQUEST_METHOD']; |
| 40 | 40 | |
| 41 | - if (! isset($this->staticRoutes[$requestMethod])) { |
|
| 41 | + if (!isset($this->staticRoutes[$requestMethod])) { |
|
| 42 | 42 | throw (new \Exception('Unsupported request method : ' . $requestMethod, - 1)); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace Mezon\Router; |
| 4 | 4 | |
| 5 | 5 | /** |