Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 23cae58

Browse filesBrowse files
committed
bug #19636 [Finder] no PHP warning on empty directory iteration (ggottwald)
This PR was squashed before being merged into the 2.7 branch (closes #19636). Discussion ---------- [Finder] no PHP warning on empty directory iteration | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Since RecursiveDirectoryIterator::SKIP_DOTS is set as flag, opendir gets a warning if an empty directory is reached Commits ------- 695e341 [Finder] no PHP warning on empty directory iteration
2 parents 81e9713 + 695e341 commit 23cae58
Copy full SHA for 23cae58

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php
+4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.