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