| Total Complexity | 3 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Collection implements IteratorAggregate |
||
| 13 | { |
||
| 14 | /** @var array */ |
||
| 15 | private $list; |
||
| 16 | |||
| 17 | public function __construct(array $list = []) |
||
| 18 | { |
||
| 19 | Assertion::allIsInstanceOf($list, Item::class); |
||
| 20 | $this->list = $list; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function add(Item $item): void |
||
| 24 | { |
||
| 25 | $this->list[] = $item; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getIterator(): Iterator |
||
| 31 | } |
||
| 32 | } |
||
| 33 |