8000 [Finder] no PHP warning on empty directory iteration · symfony/symfony@695e341 · GitHub
[go: up one dir, main page]

Skip to content

Commit 695e341

Browse files
ggottwaldfabpot
authored andcommitted
[Finder] no PHP warning on empty directory iteration
1 parent 81e9713 commit 695e341

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public function isRewindable()
137137
return $this->rewindable;
138138
}
139139

140+
if ('' === $this->getPath()) {
141+
return $this->rewindable = false;
142+
}
143+
140144
if (false !== $stream = @opendir($this->getPath())) {
141145
$infos = stream_get_meta_data($stream);
142146
closedir($stream);

0 commit comments

Comments
 (0)
0