| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 38 | public function getRoutes($method = null) |
|
| 23 | { |
||
| 24 | 38 | if ($method !== null) { |
|
| 25 | 38 | $method = strtolower($method); |
|
| 26 | 38 | return isset($this->routes[$method]) ? $this->routes[$method] : []; |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | $routes = []; |
|
| 30 | 2 | foreach ($this->routes as $routesByMethod) { |
|
| 31 | 2 | $routes = array_merge($routes, $routesByMethod); |
|
| 32 | 1 | } |
|
| 33 | 2 | return $routes; |
|
| 34 | } |
||
| 35 | } |
||
| 36 |