| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function match(ServerRequestInterface $request): ?Route |
||
| 36 | { |
||
| 37 | foreach ($this->routeContainer->getRoutes() as $route) { |
||
| 38 | if ($this->routeContainer->match($request, $route)) { |
||
| 39 | if (!in_array($request->getMethod(), $route->getAllows())) { |
||
| 40 | throw new MethodNotAllowedException($route->getAllows(), $request->getUri()->getPath(), 405); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $route; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | return null; |
||
| 48 | } |
||
| 65 |