| Conditions | 6 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 2 | public function inspect() |
|
| 19 | { |
||
| 20 | 2 | $this->splitRoutes(); |
|
| 21 | 2 | $testCases = []; |
|
| 22 | 2 | foreach ($this->exactRoutes as $method => $routes) { |
|
| 23 | 2 | if ($method == 'HEAD') { |
|
| 24 | 2 | continue; |
|
| 25 | } |
||
| 26 | /* @var Route $route */ |
||
| 27 | 2 | foreach ($routes as $route) { |
|
| 28 | 2 | $paths = $route->getPaths(); |
|
| 29 | 2 | $controller = $paths['controller']; |
|
| 30 | 2 | $action = $paths['action']; |
|
| 31 | 2 | if (is_string($controller) && is_callable([$controller, $action])) { |
|
| 32 | 2 | $testCases[$controller][$action][$method][] = $route->getPattern(); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | 2 | return $testCases; |
|
| 37 | } |
||
| 38 | } |
||
| 39 |