public function __construct($paths, $flags = null, UniformResourceLocator $locator = null) { if (!$locator) { throw new \BadMethodCallException('Use $locator->getIterator() instead'); } $this->setFlags($flags); foreach ($locator->findResources($paths) as $path) { $this->iterators[] = new FilesystemIterator($path, $this->flags); } }
public function rewind() { $this->found = []; $this->stack = $this->locator->findResources($this->path); $this->next(); }