@@ -59,7 +59,8 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | $dispatcher = Controller::create($router, $compiler); |
| 61 | 61 | |
| 62 | - return new Server(function (ServerRequestInterface $request) use ($router, $dispatcher, $compiler) { |
|
| 62 | + return new Server(function (ServerRequestInterface $request) use ($router, $dispatcher, $compiler) |
|
| 63 | + { |
|
| 63 | 64 | $httpMethod = $request->getMethod(); |
| 64 | 65 | $urlPath = Controller::normalizeUrl($request->getUri()->getPath()); |
| 65 | 66 | |
@@ -77,7 +78,8 @@ discard block |
||
| 77 | 78 | case Dispatcher::FOUND: |
| 78 | 79 | $urlPlaceholders = isset($routeInfo[2]) ? $routeInfo[2] : []; |
| 79 | 80 | |
| 80 | - try { |
|
| 81 | + try |
|
| 82 | + { |
|
| 81 | 83 | return $routeInfo[1]($request, ...array_values($urlPlaceholders)); |
| 82 | 84 | } |
| 83 | 85 | catch (\Exception $e) |