@@ -158,12 +158,12 @@ discard block |
||
| 158 | 158 | $router = new \Mezon\Router\Router(); |
| 159 | 159 | $router->addType('date', DateRouterType::class); |
| 160 | 160 | if (is_string($pattern)) { |
| 161 | - $router->addRoute($pattern, function () { |
|
| 161 | + $router->addRoute($pattern, function() { |
|
| 162 | 162 | // do nothing |
| 163 | 163 | }, $method); |
| 164 | 164 | } else { |
| 165 | 165 | foreach ($pattern as $r) { |
| 166 | - $router->addRoute($r, function () { |
|
| 166 | + $router->addRoute($r, function() { |
|
| 167 | 167 | // do nothing |
| 168 | 168 | }, $method); |
| 169 | 169 | } |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | // setup |
| 183 | 183 | $router = new Router(); |
| 184 | - for ($i = 0; $i < 15; $i ++) { |
|
| 185 | - $router->addRoute('/multiple/' . $i . '/[i:id]', function () { |
|
| 184 | + for ($i = 0; $i < 15; $i++) { |
|
| 185 | + $router->addRoute('/multiple/' . $i . '/[i:id]', function() { |
|
| 186 | 186 | return 'done!'; |
| 187 | 187 | }); |
| 188 | 188 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | // setup |
| 26 | 26 | $router = new \Mezon\Router\Router(); |
| 27 | - $router->addRoute('/catalog/[i:foo]/', function () { |
|
| 27 | + $router->addRoute('/catalog/[i:foo]/', function() { |
|
| 28 | 28 | // do nothing |
| 29 | 29 | }); |
| 30 | 30 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function testValidExtractedParameter(): void |
| 42 | 42 | { |
| 43 | 43 | $router = new \Mezon\Router\Router(); |
| 44 | - $router->addRoute('/catalog/[a:cat_id]/', function ($route, $parameters) { |
|
| 44 | + $router->addRoute('/catalog/[a:cat_id]/', function($route, $parameters) { |
|
| 45 | 45 | return $parameters['cat_id']; |
| 46 | 46 | }); |
| 47 | 47 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $router = new \Mezon\Router\Router(); |
| 59 | 59 | $router->addRoute( |
| 60 | 60 | '/catalog/[a:cat_id]/[i:item_id]', |
| 61 | - function ($route, $parameters) { |
|
| 61 | + function($route, $parameters) { |
|
| 62 | 62 | return $parameters['cat_id'] . $parameters['item_id']; |
| 63 | 63 | }); |
| 64 | 64 | |
@@ -73,10 +73,10 @@ discard block |
||
| 73 | 73 | public function testValidRouteParameter(): void |
| 74 | 74 | { |
| 75 | 75 | $router = new \Mezon\Router\Router(); |
| 76 | - $router->addRoute('/catalog/all/', function ($route) { |
|
| 76 | + $router->addRoute('/catalog/all/', function($route) { |
|
| 77 | 77 | return $route; |
| 78 | 78 | }); |
| 79 | - $router->addRoute('/catalog/[i:cat_id]', function ($route) { |
|
| 79 | + $router->addRoute('/catalog/[i:cat_id]', function($route) { |
|
| 80 | 80 | return $route; |
| 81 | 81 | }); |
| 82 | 82 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | { |
| 102 | 102 | // setup |
| 103 | 103 | $router = new Router(); |
| 104 | - for ($i = 0; $i < 15; $i ++) { |
|
| 105 | - $router->addRoute('/multiple/' . $i . '/[i:id]', function () { |
|
| 104 | + for ($i = 0; $i < 15; $i++) { |
|
| 105 | + $router->addRoute('/multiple/' . $i . '/[i:id]', function() { |
|
| 106 | 106 | return 'done!'; |
| 107 | 107 | }); |
| 108 | 108 | } |