| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | class RouteCollection implements RouteCollectionInterface, Countable |
||
| 30 | { |
||
| 31 | /** |
||
| 32 | * The collection routes |
||
| 33 | * |
||
| 34 | * @var RouteInterface[] |
||
| 35 | */ |
||
| 36 | private $routes; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Constructor of the class |
||
| 40 | * |
||
| 41 | * @param RouteInterface ...$routes |
||
| 42 | */ |
||
| 43 | 25 | public function __construct(RouteInterface ...$routes) |
|
| 44 | { |
||
| 45 | 25 | $this->routes = $routes; |
|
| 46 | 25 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritDoc} |
||
| 50 | */ |
||
| 51 | 22 | public function add(RouteInterface ...$routes): void |
|
| 55 | } |
||
| 56 | 22 | } |
|
| 57 | |||
| 58 | /** |
||
| 59 | * {@inheritdoc} |
||
| 60 | */ |
||
| 61 | 3 | public function count(): int |
|
| 62 | { |
||
| 63 | 3 | return count($this->routes); |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Gets all routes from the collection |
||
| 68 | * |
||
| 69 | * {@inheritDoc} |
||
| 70 | */ |
||
| 71 | 5 | public function getIterator() |
|
| 74 | } |
||
| 75 | } |
||
| 76 |