| Total Complexity | 8 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 95.24% |
| Changes | 1 | ||
| 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 | 24 | public function __construct(AbstractHydrator $hydrator) |
|
| 30 | { |
||
| 31 | 24 | $this->hydrator = $hydrator; |
|
| 32 | 24 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @throws HydrationException |
||
| 36 | */ |
||
| 37 | 24 | public function rewind() : void |
|
| 45 | 24 | } |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Gets the next set of results. |
||
| 49 | * |
||
| 50 | * @return mixed|false |
||
| 51 | */ |
||
| 52 | 24 | public function next() |
|
| 53 | { |
||
| 54 | 24 | $this->current = $this->hydrator->hydrateRow(); |
|
| 55 | 24 | if (is_array($this->current)) { |
|
| 56 | 23 | $this->current = array_values($this->current)[0]; |
|
| 57 | } |
||
| 58 | |||
| 59 | 24 | $this->key++; |
|
| 60 | |||
| 61 | 24 | return $this->current; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** @return mixed */ |
||
| 65 | 23 | public function current() |
|
| 66 | { |
||
| 67 | 23 | return $this->current; |
|
| 68 | } |
||
| 69 | |||
| 70 | 16 | public function key() : int |
|
| 73 | } |
||
| 74 | |||
| 75 | 24 | public function valid() : bool |
|
| 78 | } |
||
| 79 | } |
||
| 80 |
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..