public function getIterator()
{
if (!$this->paths) {
throw new Nette\InvalidStateException('Call in() or from() to specify directory to search.');
} elseif (count($this->paths) === 1) {
return $this->buildIterator($this->paths[0]);
} else {
$iterator = new \AppendIterator();
$iterator->append($workaround = new \ArrayIterator(['workaround PHP bugs #49104, #63077']));
foreach ($this->paths as $path) {
$iterator->append($this->buildIterator($path));
}
unset($workaround[0]);
return $iterator;
}
}