Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 4 | public function get($handler) |
|
26 | { |
||
27 | 4 | $route = $this->getHandler($handler); |
|
28 | 4 | if (!$route) { |
|
29 | 1 | throw HandlerException::notFound($handler); |
|
30 | } |
||
31 | |||
32 | 3 | if (is_string($route) && class_exists($route)) { |
|
33 | 1 | $route = new $route; |
|
34 | 1 | } |
|
35 | |||
36 | 3 | if (is_callable($route)) { |
|
37 | 2 | return $route; |
|
38 | } |
||
39 | |||
40 | 1 | throw HandlerException::invalidHandler($handler); |
|
41 | } |
||
42 | |||
55 |