| 1 | <?php declare(strict_types = 1); |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 2 | |||
| 3 | namespace App\Entities; |
||
| 4 | |||
| 5 | class Categories implements \IteratorAggregate { |
||
| 6 | |||
| 7 | /** @var array<\App\Entities\Category> */ |
||
| 8 | private array $categories; |
||
| 9 | |||
| 10 | 2 | public function __construct( Category ...$categories ) { |
|
| 11 | 2 | $this->categories = $categories; |
|
| 12 | 2 | } |
|
| 13 | |||
| 14 | /** |
||
| 15 | * {@inheritDoc} |
||
| 16 | */ |
||
| 17 | 1 | public function getIterator() { |
|
| 18 | 1 | return new \ArrayIterator( $this->categories ); |
|
| 19 | } |
||
| 20 | |||
| 21 | } |
||
| 22 |