Total Complexity | 6 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 72.72% |
Changes | 0 |
1 | <?php |
||
7 | class RouteCollection |
||
8 | { |
||
9 | protected $routes = []; |
||
10 | |||
11 | 8 | public function add(string $name, RouteDefinition $route) |
|
12 | { |
||
13 | 8 | if (!isset($this->routes['$name'])) { |
|
14 | 8 | $this->routes[$name] = $route; |
|
15 | |||
16 | 8 | return true; |
|
17 | } |
||
18 | throw new \InvalidArgumentException("The route {$name} already exists."); |
||
19 | } |
||
20 | |||
21 | public function get($name) |
||
24 | } |
||
25 | |||
26 | 6 | public function all() |
|
29 | } |
||
30 | |||
31 | 2 | public function count() |
|
36 |