Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
43 | 2 | public function match(ServerRequestInterface $request): RoutingResultInterface |
|
44 | { |
||
45 | 2 | foreach ($this->routes as $route) { |
|
46 | |||
47 | 2 | $requestMatchResult = $route->match($request); |
|
48 | |||
49 | 2 | if ($requestMatchResult->isSuccess()) { |
|
50 | 1 | return RoutingResult::success( |
|
51 | 1 | $route->getHandler(), |
|
52 | 1 | $requestMatchResult->getParams() |
|
53 | ); |
||
54 | } |
||
55 | } |
||
56 | |||
57 | 1 | return RoutingResult::failure(new RoutingError(404, 'route not found')); |
|
58 | } |
||
59 | } |
||
60 |