Total Complexity | 8 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 95.24% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class RowByRowResult implements Iterator |
||
16 | { |
||
17 | /** @var AbstractHydrator */ |
||
18 | private $hydrator; |
||
19 | |||
20 | /** @var bool */ |
||
21 | private $rewinded = false; |
||
22 | |||
23 | /** @var int */ |
||
24 | private $key = -1; |
||
25 | |||
26 | /** @var object|null */ |
||
27 | private $current; |
||
28 | |||
29 | 25 | public function __construct(AbstractHydrator $hydrator) |
|
32 | 25 | } |
|
33 | |||
34 | /** @inheritDoc */ |
||
35 | 25 | public function rewind() : void |
|
43 | 25 | } |
|
44 | |||
45 | /** @inheritDoc */ |
||
46 | 25 | public function next() : void |
|
47 | { |
||
48 | 25 | $this->current = $this->hydrator->hydrateRow(); |
|
|
|||
49 | 25 | if (is_array($this->current)) { |
|
50 | 23 | $this->current = array_values($this->current)[0]; |
|
51 | } |
||
52 | |||
53 | 25 | $this->key++; |
|
54 | 25 | } |
|
55 | |||
56 | /** @inheritDoc */ |
||
57 | 23 | public function current() |
|
58 | { |
||
59 | 23 | return $this->current; |
|
60 | } |
||
61 | |||
62 | /** @inheritDoc */ |
||
63 | 16 | public function key() : int |
|
66 | } |
||
67 | |||
68 | /** @inheritDoc */ |
||
69 | 25 | public function valid() : bool |
|
72 | } |
||
73 | } |
||
74 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..