[Finder] no PHP warning on empty directory iteration

This commit is contained in:
Götz Gottwald 2016-08-16 16:22:05 +02:00 committed by Fabien Potencier
parent 81e9713c80
commit 695e341258
1 changed files with 4 additions and 0 deletions

View File

@ -137,6 +137,10 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
return $this->rewindable;
}
if ('' === $this->getPath()) {
return $this->rewindable = false;
}
if (false !== $stream = @opendir($this->getPath())) {
$infos = stream_get_meta_data($stream);
closedir($stream);