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