for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\ORM\Internal\Hydration;
use Iterator;
use function array_values;
use function is_array;
/**
* Represents a result structure that can be iterated over, hydrating row-by-row
* during the iteration. An IterableResult is obtained by AbstractHydrator#getIterable().
*/
final class RowByRowResult implements Iterator
{
/** @var AbstractHydrator */
private $hydrator;
/** @var bool */
private $rewinded = false;
/** @var int */
private $key = -1;
/** @var object|null */
private $current;
public function __construct(AbstractHydrator $hydrator)
$this->hydrator = $hydrator;
}
/** @inheritDoc */
public function rewind() : void
if ($this->rewinded === true) {
throw new HydrationException('Can only iterate a Result once.');
$this->next();
$this->rewinded = true;
public function next() : void
$this->current = $this->hydrator->hydrateRow();
$this->hydrator->hydrateRow()
false
null|object
$current
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..
if (is_array($this->current)) {
is_array($this->current)
$this->current = array_values($this->current)[0];
$this->key++;
public function current()
return $this->current;
public function key() : int
return $this->key;
public function valid() : bool
return $this->current !== false;
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..