Total Complexity | 6 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
29 | class RouteCollection implements RouteCollectionInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * The collection routes |
||
34 | * |
||
35 | 24 | * @var RouteInterface[] |
|
36 | */ |
||
37 | 24 | private $routes; |
|
38 | |||
39 | 24 | /** |
|
40 | * Constructor of the class |
||
41 | * |
||
42 | * @param RouteInterface ...$routes |
||
43 | */ |
||
44 | public function __construct(RouteInterface ...$routes) |
||
45 | 25 | { |
|
46 | $this->routes = $routes; |
||
47 | 25 | } |
|
48 | |||
49 | /** |
||
50 | * {@inheritDoc} |
||
51 | */ |
||
52 | public function add(RouteInterface ...$routes) : void |
||
56 | } |
||
57 | 21 | } |
|
58 | |||
59 | 21 | /** |
|
60 | * {@inheritDoc} |
||
61 | */ |
||
62 | public function all() : array |
||
63 | { |
||
64 | return $this->routes; |
||
65 | 2 | } |
|
66 | |||
67 | 2 | /** |
|
68 | * Gets the number of routes in the collection |
||
69 | 2 | * |
|
70 | * @return int |
||
71 | */ |
||
72 | public function count() |
||
75 | 11 | } |
|
76 | |||
77 | 11 | /** |
|
78 | * Gets an external iterator |
||
79 | 11 | * |
|
80 | * @return ArrayIterator |
||
81 | */ |
||
82 | public function getIterator() |
||
87 |