| Total Complexity | 6 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class ManufacturerDTOArray extends IteratorIterator implements Iterator |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * ManufacturerDTOArray constructor. |
||
| 23 | * @param ManufacturerDTOInterface[]|null[] ...$manufacturerDTOs |
||
| 24 | */ |
||
| 25 | 24 | public function __construct(?ManufacturerDTOInterface ...$manufacturerDTOs) |
|
| 26 | { |
||
| 27 | 24 | parent::__construct(new ArrayIterator($manufacturerDTOs)); |
|
| 28 | 24 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @return ManufacturerDTOInterface |
||
| 32 | */ |
||
| 33 | 10 | public function current(): ManufacturerDTOInterface |
|
| 34 | { |
||
| 35 | 10 | return $this->getInnerIterator()->current(); |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param ManufacturerDTOInterface $manufacturerDTO |
||
| 40 | */ |
||
| 41 | 5 | public function add(ManufacturerDTOInterface $manufacturerDTO): void |
|
| 42 | { |
||
| 43 | 5 | $this->getInnerIterator()->append($manufacturerDTO); |
|
|
|
|||
| 44 | 5 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @param int $key |
||
| 48 | * @param ManufacturerDTOInterface $manufacturerDTO |
||
| 49 | */ |
||
| 50 | 3 | public function set(int $key, ManufacturerDTOInterface $manufacturerDTO): void |
|
| 53 | 3 | } |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @param int $key |
||
| 57 | * @return ManufacturerDTOInterface |
||
| 58 | */ |
||
| 59 | 11 | public function get(int $key): ManufacturerDTOInterface |
|
| 60 | { |
||
| 61 | 11 | return $this->getInnerIterator()->offsetGet($key); |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return int |
||
| 66 | */ |
||
| 67 | 6 | public function count(): int |
|
| 70 | } |
||
| 71 | } |
||
| 72 |