| Total Complexity | 3 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class Collection implements IteratorAggregate |
||
| 22 | { |
||
| 23 | /** @var array */ |
||
| 24 | private $list; |
||
| 25 | |||
| 26 | public function __construct(array $list = []) |
||
| 27 | { |
||
| 28 | Assertion::allIsInstanceOf($list, Item::class); |
||
| 29 | $this->list = $list; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function add(Item $item): void |
||
| 33 | { |
||
| 34 | $this->list[] = $item; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getIterator(): Iterator |
||
| 40 | } |
||
| 41 | } |
||
| 42 |