IteratorAggregate (note: using Iterator conflicts with next method in jquery)

@return \ArrayIterator containing nodes as instances of DomQuery
14408
public function getIterator()
    {
        $iteration_result = array();
        if (\is_array($this->nodes)) {
            foreach ($this->nodes as $node) {
                $iteration_result[] = $this->createChildInstance($node);
            }
        }

        return new \ArrayIterator($iteration_result);
    }
1332407
private function _iterator()
    {
        if(!isset($this->_iterator))
            $this->_iterator = $this->_resultSet()->getIterator();

        return $this->_iterator;
    }
662122
public function getIterator()
    {
        if (!count($this->errors)) {
            $this->errors[$this->attribute] = $this->getMessage();
        }

        return new \ArrayIterator($this->errors);
    }
191248
public function getIterator()
    {
        $files = array();
        $iterator = $this->getFlyIterator(Directory::ITERATOR_FILE | Directory::ITERATOR_RECURSIVE);
        foreach ($iterator as $file) {
            $files[] = $this->getRelPath($file);
        }
        return new ArrayIterator($files);
    }
1263927
public function getIterator() {
		if($this->loaded == false) {
			$this->items = $this->getReferences();
			$this->loaded = true;
		}
		foreach($this->items as $i => $item) {
			if(is_array($item)) $this->items[$i] = new ArrayData($item);
		}
		return new ArrayIterator($this->items);
	}
214621
public function readElements()
  {
    $iterator = new ArrayIterator;
    do
    {
      $object = $this->readElement();
      if($object) $iterator->append($object);
    } while((boolean)$object);

    $this->objects = $iterator;
    return $this->objects;
  }
1121990
public function getIterator() : iterable
    {
        foreach ($this->bufferedChanges as $change) {
            yield $change;
        }

        foreach ($this->unBufferedChanges ?? [] as $change) {
            $this->bufferedChanges[] = $change;

            yield $change;
        }

        $this->unBufferedChanges = null;
    }
704691
public function unwrap()
    {
        $iterator = $this->getInnerIterator();

        if ($iterator instanceof CollectionInterface) {
            $iterator = $iterator->unwrap();
        }

        if (get_class($iterator) !== ArrayIterator::class) {
            return $this;
        }

        // ArrayIterator can be traversed strictly.
        // Let's do that for performance gains

        $callback = $this->_extractor;
        $res = [];

        foreach ($iterator->getArrayCopy() as $k => $v) {
            $res[$k] = $callback($v);
        }

        return new ArrayIterator($res);
    }
678496
public function getIterator() {
        $ret = array('id' => $this->record->id);
        foreach ($this->record as $property => $value) {
            $ret[$property] = $value;
        }
        return new ArrayIterator($ret);
    }
19736
protected function getIterator()
    {
        if ($this->iterator === null && $this->isExists()) {
            $dirIterator = new DirectoryIterator($this->getPathname());
            $this->iterator = new CallbackFilterIterator($dirIterator, function ($current, $key, $iterator) {
                return !$iterator->isDot();
            });
        }

        return $this->iterator;
    }
353284
public function toArray()
    {
        $result = array();
        if($row = $this->getIterator()->current()) {
            $result = $row->toArray();
        }

        return $result;
    }
258305
protected function toArrayTree()
    {
        $classname = $this->getDottedClassname();
        $lastLevel = $this->buildLevel($classname);
        
        foreach ($this->getMethods() as $method) {
            $lastLevel[$method->getName()] = $method->toArray();
        }
        
        return $this->methods;
    }
782351
public function getIterator()
    {
        if ($this->_result === false) {
            return new \EmptyIterator();
        }

        if (!isset($this->_iterator)) {
            $this->_iterator = new ResultIterator($this->_result);
            $this->_iterator->setHydrator($this->_hydrator);
        }

        return $this->_iterator;
    }
1373053
public function getIterator() {
        $ret = array();
        foreach (self::$coursecatfields as $property => $unused) {
            if ($this->$property !== false) {
                $ret[$property] = $this->$property;
            }
        }
        return new ArrayIterator($ret);
    }
371921
public function getIterator()
    {
        $values = array();
        foreach ($this->values as $key => $val) {
            $values[$key] = array(
                'key' => $key,
                'value' => $val,
                'first' => false,
                'last' => false
            );
        }
        $keys = array_keys($values);
        if (!empty($keys)) {
            $values[reset($keys)]['first'] = true;
            $values[end($keys)]['last'] = true;
        }
        return new \ArrayIterator($values);
    }
950136
public function getIterator(): \Traversable
    {
        $result = [];
        foreach ($this->links as $link) {
            if (is_array($link)) {
                $result = array_merge($result, $link);
            } else {
                $result[] = $link;
            }
        }

        return new \ArrayIterator($result);
    }
288042
private static function getAllRemaining(\ArrayIterator $iterator): array
    {
        $values = [];
        while ($iterator->valid()) {
            $values[] = $iterator->current();
            $iterator->next();
        }

        return $values;
    }