@param \ArrayIterator $iterator

@return RData\RDataInterface

@throws ParseException
2516
private function extractRdata(\ArrayIterator $iterator): Rdata\RdataInterface
    {
        $type = strtoupper($iterator->current());
        $iterator->next();

        if (array_key_exists($type, $this->rdataHandlers)) {
            try {
                return call_user_func($this->rdataHandlers[$type], $iterator);
            } catch (\Exception $exception) {
                throw new ParseException($exception->getMessage(), null, $exception);
            }
        }

        return RdataHandlers::catchAll($type, $iterator);
    }
870638
public function getIterator()
    {
        $entries = array_slice($this->getResults(), $this->getCurrentOffset(), $this->getPerPage(), true);

        return new ArrayIterator($entries);
    }
927900
public function filter($collection = null, $iterator = null)
    {
        $return = array();
        foreach ($collection as $val) {
            if (call_user_func($iterator, $val)) {
                $return[] = $val;
            }
        }
        return $return;
    }
33372
public static function first(Iterator $iterator)
    {
        $iterator->rewind();
        if (!$iterator->valid()) {
            throw new InvalidArgumentException("Iterator is empty");
        }
        return $iterator->current();
    }
263924
public function getIterator(): Iterator
    {
        return new CallbackFilterIterator(
            new RecursiveIteratorIterator(
                new RecursiveDirectoryIterator($this->path, FilesystemIterator::SKIP_DOTS),
                RecursiveIteratorIterator::CHILD_FIRST
            ),
            function ($current) {
                return $this->match($current);
            }
        );
    }
197797
private function loadFromIterator(\Iterator $iterator)
    {
        $includedFiles = [];

        foreach ($iterator as $file) {
            if (($fileName = $file->getBasename($this->fileExtension)) == $file->getBasename()) {
                continue;
            }

            $sourceFile = realpath($file->getPathName());
            require_once $sourceFile;
            $includedFiles[] = $sourceFile;
        }

        $fixtures = [];
        $declared = get_declared_classes();

        foreach ($declared as $className) {
            $reflClass = new \ReflectionClass($className);
            $sourceFile = $reflClass->getFileName();

            if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) {
                $fixture = new $className();
                $fixtures[] = $fixture;
                $this->addFixture($fixture);
            }
        }

        return $fixtures;
    }
55030
public function write(Iterator $dataIterator)
    {
        $this->initialize();
        foreach ($dataIterator as $item) {
            $this->writeItem($item);
        }
        $this->finish();
    }
712233
public static function handleAplRdata(\ArrayIterator $iterator): Rdata\APL
    {
        $rdata = new Rdata\APL();

        while ($iterator->valid()) {
            $matches = [];
            if (1 !== preg_match('/^(?<negate>!)?[1-2]:(?<block>.+)$/i', $iterator->current(), $matches)) {
                throw new ParseException(sprintf('"%s" is not a valid IP range.', $iterator->current()));
            }

            $ipBlock = \IPBlock::create($matches['block']);
            $rdata->addAddressRange($ipBlock, '!' !== $matches['negate']);
            $iterator->next();
        }

        return $rdata;
    }
326837
public function each(callable $iterator) : Collection
    {
        foreach ($this as $k => $v) {
            call_user_func($iterator, $v, $k, $this);
        }
        return $this;
    }
1041557
private static function AtomizeIterator( $iter )
	{
		/**
		 * @var XPathNavigator $item
		 */
		foreach ( $iter as $item )
		{
			if ( $item->getIsNode() )
			{
				if ( $item->getNodeType() == XPathNodeType::Comment )
				{
					continue;
				}

				if ( $item->getNodeType() == XPathNodeType::Element )
				{
					$child = $item->CloneInstance();
					$result = $child->MoveToFirstChild();

					$items = array();

					if ( $child->getNodeType() == XPathNodeType::Text )
					{
						$items[] = $item->getTypedValue();
					}
					else
					{
						while ( $result )
						{
							$data = ExtFuncs::GetData( XPath2NodeIterator::Create( $child->CloneInstance() ) );
							if ( $data->MoveNext() )
							{
								$items[] = $data->getCurrent(); // ->getValue();
							}

							$result = $child->MoveToNext();
						}
					}

					if ( ! count( $items ) )
					{
						yield Undefined::getValue();
					}
					else if ( count( $items ) == 1 )
					{
						yield $items[0];
					}
					else
					{
						yield XPath2Item::fromValueAndType( implode( "", $items ), XmlSchema::$String );
					}

					return false;
				}
				else
				if ( is_null( $item->getTypedValue() ) )
				{
			    	if ( $item instanceof XPathNavigator )
					{
						/**
						 * @var XPathNavigator $nav
						 */
						$nav = $item;
						if ( ! is_null( $nav->getSchemaInfo() ) &&
							 ! is_null( $nav->getSchemaInfo()->getSchemaType() ) &&
							 ! ( $nav->getSchemaInfo()->getSchemaType() instanceof XmlSchemaSimpleType ) )
						{
							throw XPath2Exception::withErrorCodeAndParam( "FOTY0012", Resources::FOTY0012, new XmlQualifiedName( $nav->LocalName, $nav->NamespaceURI, false ) );
						}
					}
				}
			}

		    yield $item instanceof XPath2Item
		    	? $item
		    	: XPath2Item::fromValue( $item->GetTypedValue() );
		}
	}
641353
public function getIterator()
    {
        if ($this->iteratorCreator) {
            return call_user_func($this->iteratorCreator, $this, $this->filesystem);
        }

        return $this->createIterator();
    }
457329
public function getIterator()
    {
        if (is_null($this->_iterator)) {
            $this->_iterator = new Iterator($this->_items);
        }
        return $this->_iterator;
    }
218170
protected function _setIterator($iterator)
    {
        if ($iterator !== null && !($iterator instanceof IteratorInterface)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not an iterator instance'),
                null,
                null,
                $iterator
            );
        }

        $this->iterator = $iterator;
    }
750595
public function getIterator()
    {
        return new \ArrayIterator(array(
            'cod' => $this->getCod(),
            'cod_amount' => $this->getCodAmount(),
            'exw' => $this->getExw(),
            'rod' => $this->getRod(),
            'pod' => $this->getPod(),
            'exc' => $this->getExc(),
            'ident' => $this->getIdent(),
            'daw' => $this->getDaw(),
            'ps' => $this->getPs(),
            'pr' => $this->getPr(),
            's10' => $this->getS10(),
            's12' => $this->getS12(),
            'sat' => $this->getSat(),
            'ow' => $this->getOw(),
            'srs' => $this->getSrs()
        ));
    }
87824
private function getIterator($value)
    {
        if ($value instanceof \Iterator) {

            return $value;
        }

        if (is_array($value)) {

            return new \ArrayIterator($value);
        }

        return new \ArrayIterator([$value]);
    }
98463
public static function Remove( $iter, $index )
	{
		return new NodeIterator( function() use( $iter, $index ) { return ExtFuncs::RemoveIterator( $iter->CloneInstance(), $index ); } );
	}
55704
public function getIterator()
    {

        $result = $this->data !== null ? $this->data : call_user_func($this->getter);

        if (!$result) {
            return new ArrayIterator([]);
        }

        if ($result instanceof Iterator) {
            return $result;
        }

        if (is_array($result)) {
            return new ArrayIterator($result);
        }

        if (!$result instanceof Traversable) {
            throw new UnexpectedValueException('The returned result of the assigned callable is not supported (traversable)');
        }

        $array = [];

        foreach ($result as $item) {
            $array[] = $item;
        }

        return new ArrayIterator($array);
    }