@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | public function buildRoutes(array $routes): void |
80 | 80 | { |
81 | - $routes = function (RouteCollector $router) use ($routes): void { |
|
81 | + $routes = function(RouteCollector $router) use ($routes): void { |
|
82 | 82 | foreach ($routes as $route) { |
83 | 83 | foreach ($route['methods'] as $method) { |
84 | 84 | $router->addRoute($method, $route['pattern'], 'phpinfo'); |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $router = new Router('/', new UriHandler(new UriFactory()), $container); |
87 | 87 | |
88 | 88 | foreach ($routes as $route) { |
89 | - $spRoute = new Route($route['pattern'], fn () => 'Hello World'); |
|
89 | + $spRoute = new Route($route['pattern'], fn() => 'Hello World'); |
|
90 | 90 | $spRoute->withVerbs(...$route['methods']); |
91 | 91 | |
92 | 92 | $router->setRoute($route['name'], $spRoute); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | foreach ($methods as $method) { |
85 | 85 | $path = ($this->strategy)($method, $host); |
86 | - $server = []; |
|
86 | + $server = []; |
|
87 | 87 | |
88 | 88 | if ($host !== '*') { |
89 | 89 | $server['HTTP_HOST'] = $host . 'laravel'; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | foreach ($routes as $route) { |
112 | 112 | $action = [ |
113 | - 'uses' => function ($id = 'Hello') { |
|
113 | + 'uses' => function($id = 'Hello') { |
|
114 | 114 | return $id; |
115 | 115 | }, |
116 | 116 | ]; |
@@ -108,7 +108,7 @@ |
||
108 | 108 | $collection = $routerContainer->getMap(); |
109 | 109 | |
110 | 110 | foreach ($routes as $route) { |
111 | - $auraRoute = $collection->route($route['name'], $route['pattern'], fn () => 'Hello'); |
|
111 | + $auraRoute = $collection->route($route['name'], $route['pattern'], fn() => 'Hello'); |
|
112 | 112 | |
113 | 113 | if ($route['host'] !== '*') { |
114 | 114 | $auraRoute->host($route['host']); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | foreach ($methods as $method) { |
62 | 62 | $path = ($this->strategy)($method); |
63 | - $request = new Request(new UrlScript($path . 'nette' . $method), null, null, null, null, $method); |
|
63 | + $request = new Request(new UrlScript($path . 'nette' . $method), null, null, null, null, $method); |
|
64 | 64 | |
65 | 65 | if (null === $this->router->match($request)) { |
66 | 66 | return false; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | foreach ($methods as $method) { |
86 | 86 | $path = ($this->strategy)($method, $host); |
87 | - $uri = new UrlScript($path . 'nette' . $method); |
|
87 | + $uri = new UrlScript($path . 'nette' . $method); |
|
88 | 88 | |
89 | 89 | if ($host !== '*') { |
90 | 90 | $uri = $uri->withHost($host . 'nette'); |
@@ -116,7 +116,7 @@ |
||
116 | 116 | */ |
117 | 117 | public function buildRoutes(array $routes): void |
118 | 118 | { |
119 | - $resource = static function () use ($routes): RouteCollection { |
|
119 | + $resource = static function() use ($routes): RouteCollection { |
|
120 | 120 | $sfCollection = new RouteCollection(); |
121 | 121 | |
122 | 122 | foreach ($routes as $route) { |
@@ -121,7 +121,7 @@ |
||
121 | 121 | $route['pattern'], |
122 | 122 | $route['methods'], |
123 | 123 | new CallableRequestHandler( |
124 | - function (ServerRequestInterface $request): ResponseInterface { |
|
124 | + function(ServerRequestInterface $request): ResponseInterface { |
|
125 | 125 | return (new ResponseFactory())->createJsonResponse(200, [ |
126 | 126 | 'status' => 'ok', |
127 | 127 | 'method' => $request->getMethod(), |
@@ -38,7 +38,7 @@ |
||
38 | 38 | ]; |
39 | 39 | |
40 | 40 | // This generates routes for router and matches them. |
41 | -$routerGenerator = static function (array $config, CaseInterface $strategy, string $router) { |
|
41 | +$routerGenerator = static function(array $config, CaseInterface $strategy, string $router) { |
|
42 | 42 | [$type, $isolated, $nbRoutes, $nbHosts, $cache] = $config; |
43 | 43 | |
44 | 44 | $generator = new RouteGenerator($isolated, $nbRoutes, $nbHosts); |