Returns an Iterator for the current Finder configuration.

This method implements the IteratorAggregate interface.

@return \Iterator|SplFileInfo[] An iterator

@throws \LogicException if the in() method has not been called
425420
public function getIterator()
    {
        if (0 === \count($this->dirs) && 0 === \count($this->iterators)) {
            throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.');
        }

        if (1 === \count($this->dirs) && 0 === \count($this->iterators)) {
            return $this->searchInDirectory($this->dirs[0]);
        }

        $iterator = new \AppendIterator();
        foreach ($this->dirs as $dir) {
            $iterator->append($this->searchInDirectory($dir));
        }

        foreach ($this->iterators as $it) {
            $iterator->append($it);
        }

        return $iterator;
    }
1017133
public function getIterator()
    {
        $evaluatedArray = [];
        foreach ($this->partialFusionTree as $key => $value) {
            if (!is_array($value)) {
                $evaluatedArray[$key] = $value;
            } elseif (isset($value['__objectType'])) {
                $evaluatedArray[$key] = $this->fusionRuntime->evaluate($this->path . '/' . $key);
            } elseif (isset($value['__eelExpression'])) {
                $evaluatedArray[$key] = $this->fusionRuntime->evaluate($this->path . '/' . $key, $this->templateImplementation);
            } else {
                $evaluatedArray[$key] = new FusionPathProxy($this->templateImplementation, $this->path . '/' . $key, $this->partialFusionTree[$key]);
            }
        }
        return new \ArrayIterator($evaluatedArray);
    }
408459
private function getEntryIterator()
    {
        $files = $this->days->current();
        $files = new \DirectoryIterator($this->days->current());
        $historyEntries = [];

        foreach ($files as $file) {
            if (!$file->isFile()) {
                continue;
            }

            if ($file->getExtension() !== 'xml') {
                continue;
            }

            $historyEntries[] = $this->getHistoryEntry($file->getPathname());
        }
        usort($historyEntries, function ($entry1, $entry2) {
            if ($entry1->getDate()->format('U') === $entry2->getDate()->format('U')) {
                return;
            }

            return $entry1->getDate()->format('U') < $entry2->getDate()->format('U');
        });

        return new \ArrayIterator($historyEntries);
    }
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);
            }
        );
    }
116218
public function getIterator()
    {
        if (!file_exists($this->filepath)) {
            //TODO: throw exception instead?
            return null;
        }
        $header = $this->hasheader ? $this->getFirstRow() : null;
        $output = array();

        $config = new LexerConfig();
        $config->setDelimiter($this->delimiter);
        $config->setEnclosure($this->enclosure);
        $config->setIgnoreHeaderLine($this->hasheader);

        $interpreter = new Interpreter();
        // Ignore row column count consistency
        $interpreter->unstrict();
        $interpreter->addObserver(function (array $row) use (&$output, $header) {
            if ($header) {
                //create new row using headings as keys
                $newrow = array();
                foreach ($header as $k => $heading) {
                    if (isset($row[$k])) {
                        $newrow[$heading] = $row[$k];
                    }
                }
                $row = $newrow;
            }
            $output[] = $row;
        });

        $lexer = new Lexer($config);
        $lexer->parse($this->filepath, $interpreter);

        return new ArrayIterator($output);
    }
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;
    }
724288
public function getIterator()
    {
        // Recursively resolve until we hit a real schema
        //because you can't use get_object_vars on a reference.
        $schema = $this->resolve();
        while ($schema instanceof Reference) {
            $schema = $schema->resolve();
        }

        if (!is_object($schema) && !is_array($schema)) {
            throw new \InvalidArgumentException(
                sprintf('Expected an object or array, got "%s"', gettype($schema))
            );
        }

        return new \ArrayIterator(is_object($schema) ? get_object_vars($schema) : $schema);
    }
403903
public function getIterator() {
        $ret = array(
            'id'           => $this->id,
            'contextlevel' => $this->contextlevel,
            'instanceid'   => $this->instanceid,
            'path'         => $this->path,
            'depth'        => $this->depth,
            'locked'       => $this->locked,
        );
        return new ArrayIterator($ret);
    }
1113335
public function getIterator() {
        $iterator = new AppendIterator;

        if($this->wrapped_object instanceof IteratorAggregate) {
            $iterator->append($element->getIterator());
        }
        else {
            $iterator->append(new ArrayIterator($this->wrapped_object));
        }
        $iterator->append(parent::getIterator());
        return $iterator;
    }
649482
public function getIterator()
    {
        $csv = fopen($this->getConfig('file'), 'r');
        if ($csv === false) {
            throw new \RuntimeException('Unable to open file: ' . $this->getConfig('file'));
        }
        while (true) {
            $fields = fgetcsv(
                $csv,
                0,
                $this->getConfig('delimiter'),
                $this->getConfig('quote'),
                $this->getConfig('escape')
            );
            if ($fields === false) {
                break;
            }
            ++$this->line;
            if ($this->columns === null && $this->getConfig('header') === true) {
                $this->columns = array_map(function ($field) { return trim($field); }, $fields);
                if (count($this->columns) !== count(array_unique($this->columns))) {
                    throw new \RuntimeException(
                        'File does not have unique column headers: ' . $this->getConfig('file')
                    );
                }
            } else {
                $row = $this->getConfig('header') === true ? $this->map($fields) : $fields;
                yield empty($this->getConfig('callbacks')) === true ? $row : $this->callback($row);
            }
        }
        fclose($csv);
    }
286845
public function findAll()
    {
        $finder = new DoctrineCollectionFinder(
            $this->connection,
            $this->table,
            $this->entityClass,
            $this->entityRegistry
        );
        $finder->setDispatcher($this->getDispatcher());

        return $finder;
    }
283635
public function getIterator()
    {
        $header = $this->getHeader();

        while ($data = $this->getNextDataSet()) {
            $headerColumns = count($header);
            $dataColumns   = count($data);

            if ($headerColumns > $dataColumns && $this->appendRowsColumns) {
                $data = array_pad($data, $headerColumns, '');
                $this->malformedStatistic['appended']++;
            } elseif ($headerColumns < $dataColumns && $this->truncateRowsColumns) {
                $data = array_slice($data, 0, $headerColumns);
                $this->malformedStatistic['truncated']++;
            } elseif ($headerColumns != $dataColumns) {
                if ($this->ignoreMalformed) {
                    $this->malformedStatistic['malformed']++;
                    continue;
                }
                throw new Exception("Count mismatch in line {$this->getLineNumber()}, expected: {$headerColumns}, got: {$dataColumns}");
            }

            $set = array_combine($header, $data);
            yield $set;
        }
    }
436215
public function getIterator()
    {
        $iterator = parent::getIterator();

        if ( $this->id )
        {
            $iterator->append( new ArrayIterator( array(
                'seoUri' => $this->getSeoUri(),
            ) ) );
        }

        return $iterator;
    }
583091
public function getIterator()
	{
		if($this->shared)
		{
			foreach($this->bindings as $key => $binding)
			{
				if(empty($this->bound[$key]))
				{
					$this->bound[$key] = $this->container->getBound($binding);
				}
			}
			
			return new \ArrayIterator($this->bound);
		}
		
		$bound = [];
		
		foreach($this->bindings as $key => $binding)
		{
			$bound[$key] = $this->container->getBound($binding);
		}
		
		return new \ArrayIterator($bound);
	}
795074
public function getIterator()
    {
        foreach ($this->rawIterator() as $data) {
            $this->data = $this->persistence->typecastLoadRow($this, $data);
            if ($this->id_field) {
                $this->id = isset($data[$this->id_field]) ? $data[$this->id_field] : null;
            }

            // you can return false in afterLoad hook to prevent to yield this data row
            // use it like this:
            // $model->addHook('afterLoad', function ($m) {
            //     if ($m['date'] < $m->date_from) $m->breakHook(false);
            // })

            // you can also use breakHook() with specific object which will then be returned
            // as a next iterator value

            $ret = $this->hook('afterLoad');

            if ($ret === false) {
                continue;
            }

            if (is_object($ret)) {
                if ($ret->id_field) {
                    yield $ret->id => $ret;
                } else {
                    yield $ret;
                }
            } else {
                if ($this->id_field) {
                    yield $this->id => $this;
                } else {
                    yield $this;
                }
            }
        }

        $this->unload();
    }
17611
public function getIterator()
    {
        $refunds = [];
        $response = $this->httpRequest($this->getPath(), Requests::GET);
        foreach ($response->refunds as $refund) {
            $refunds[] = $this->populate($refund);
        }

        return new ArrayIterator($refunds);
    }
541962
private function getFinder(): \Iterator
    {
        return Finder::create()
            ->in($this->rootDir)
            ->ignoreUnreadableDirs()
            ->files()
            ->name('*.xlf')
            ->getIterator();
    }