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