*/ private $data; /** @var int */ public $index; /** @var string */ public $input; public function __construct(array $results) { $this->data = $results; } /** * {@inheritdoc} */ public function getIterator() { return new \ArrayIterator($this->data); } /** * {@inheritdoc} */ public function offsetExists($offset) { return isset($this->data[$offset]); } /** * {@inheritdoc} */ public function offsetGet($offset) { return $this->data[$offset]; } /** * {@inheritdoc} */ public function offsetSet($offset, $value) { throw new \LogicException(__CLASS__ . ' instances are read-only.'); } /** * {@inheritdoc} */ public function offsetUnset($offset) { throw new \LogicException(__CLASS__ . ' instances are read-only.'); } /** * {@inheritdoc} */ public function count() { return count($this->data); } }