function Finder::append
Appends an existing set of files/directories to the finder.
The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
Return value
$this
File
-
vendor/
symfony/ finder/ Finder.php, line 703
Class
- Finder
- Finder allows to build rules to find files and directories.
Namespace
Symfony\Component\FinderCode
public function append(iterable $iterator) : static {
if ($iterator instanceof \IteratorAggregate) {
$this->iterators[] = $iterator->getIterator();
}
elseif ($iterator instanceof \Iterator) {
$this->iterators[] = $iterator;
}
else {
$it = new \ArrayIterator();
foreach ($iterator as $file) {
$file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);
$it[$file->getPathname()] = $file;
}
$this->iterators[] = $it;
}
return $this;
}