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