Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class Router extends LeagueRouter implements RequestHandlerInterface, RouterInterface |
||
14 | { |
||
15 | /** |
||
16 | * @return Route[] |
||
17 | */ |
||
18 | public function getRoutes(): array |
||
19 | { |
||
20 | return $this->routes; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return RouteGroup[] |
||
25 | */ |
||
26 | public function getGroups(): array |
||
27 | { |
||
28 | return $this->groups; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param Route $route |
||
33 | */ |
||
34 | public function removeRoute(Route $routeToRemove): void |
||
35 | { |
||
36 | foreach ($this->routes as $index => $route) { |
||
37 | if ($route === $routeToRemove) { |
||
38 | unset($this->routes[$index]); |
||
39 | } |
||
40 | } |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param ServerRequestInterface $request |
||
45 | * @return ResponseInterface |
||
46 | */ |
||
47 | public function handle(ServerRequestInterface $request): ResponseInterface |
||
50 | } |
||
51 | } |
||
52 |