| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function __invoke(Request $req, Response $res, callable $next) |
||
| 23 | { |
||
| 24 | $routeInfo = $this->app['routeInfo']; |
||
| 25 | |||
| 26 | // resolve the route |
||
| 27 | if ($routeInfo[0] === Dispatcher::FOUND) { |
||
| 28 | return $this->app['route_resolver']->resolve($routeInfo[1], $req, $res, $routeInfo[2]); |
||
| 29 | } |
||
| 30 | |||
| 31 | // handle 405 Method Not Allowed errors |
||
| 32 | if ($routeInfo[0] === Dispatcher::METHOD_NOT_ALLOWED) { |
||
| 33 | return $this->app['method_not_allowed_handler']($req, $res, $routeInfo[1]); |
||
| 34 | } |
||
| 35 | |||
| 36 | // handle 404 Not Found errors |
||
| 37 | return $this->app['not_found_handler']($req, $res); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |