Total Complexity | 6 |
Total Lines | 77 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | abstract class GenericIterator implements IteratorInterface, Iterator |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @inheritDoc |
||
12 | */ |
||
13 | abstract public function hasNext(); |
||
14 | |||
15 | /** |
||
16 | * @inheritDoc |
||
17 | */ |
||
18 | abstract public function moveNext(); |
||
19 | |||
20 | /** |
||
21 | * @inheritDoc |
||
22 | */ |
||
23 | abstract public function count(); |
||
24 | |||
25 | /** |
||
26 | * @inheritDoc |
||
27 | */ |
||
28 | #[\ReturnTypeWillChange] |
||
29 | abstract public function key(); |
||
30 | |||
31 | /** |
||
32 | * @inheritDoc |
||
33 | * @throws \ByJG\Serializer\Exception\InvalidArgumentException |
||
34 | */ |
||
35 | 14 | public function toArray($fields = []) |
|
36 | { |
||
37 | 14 | $retArray = []; |
|
38 | |||
39 | 14 | foreach ($this as $singleRow) { |
|
40 | 14 | $retArray[] = $singleRow->toArray($fields); |
|
41 | } |
||
42 | |||
43 | 14 | return $retArray; |
|
44 | } |
||
45 | |||
46 | /* ------------------------------------- */ |
||
47 | /* PHP 5 Specific functions for Iterator */ |
||
48 | /* ------------------------------------- */ |
||
49 | |||
50 | /** |
||
51 | * @return mixed |
||
52 | */ |
||
53 | #[\ReturnTypeWillChange] |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @inheritDoc |
||
61 | */ |
||
62 | #[\ReturnTypeWillChange] |
||
63 | 15 | public function rewind() |
|
64 | { |
||
65 | // There is no necessary |
||
66 | 15 | } |
|
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | */ |
||
71 | #[\ReturnTypeWillChange] |
||
72 | 15 | public function next() |
|
73 | { |
||
74 | // There is no necessary |
||
75 | 15 | } |
|
76 | |||
77 | /** |
||
78 | * @inheritDoc |
||
79 | */ |
||
80 | #[\ReturnTypeWillChange] |
||
84 | } |
||
85 | } |
||
86 |