| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 48 | 12 | public function match($method, $uri) |
|
| 49 | { |
||
| 50 | 12 | $routeInfo = $this->dispatcher->dispatch($method, $uri); |
|
| 51 | |||
| 52 | 12 | switch ($routeInfo[0]) { |
|
| 53 | 12 | case Dispatcher::METHOD_NOT_ALLOWED: |
|
| 54 | 3 | throw new MethodNotAllowedException($method, $routeInfo[1]); |
|
| 55 | 9 | case Dispatcher::NOT_FOUND: |
|
| 56 | 3 | throw new NotFoundException($uri); |
|
| 57 | 6 | } |
|
| 58 | |||
| 59 | 6 | return new Result($this->routes[$routeInfo[1]], $routeInfo[2]); |
|
| 60 | } |
||
| 61 | } |
||
| 62 |