8000 minor #50885 [Finder] Fix children condition in ExcludeDirectoryFilte… · symfony/symfony@9c1dedb · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c1dedb

Browse files
minor #50885 [Finder] Fix children condition in ExcludeDirectoryFilterIterator (mvorisek)
This PR was merged into the 5.4 branch. Discussion ---------- [Finder] Fix children condition in ExcludeDirectoryFilterIterator | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | no | License | MIT | Doc PR | no see https://github.com/php/php-src/blob/6091603b5350c1ca0e792a6da604e25e2a0121c8/ext/spl/spl_directory.h#L113 Original `isDir` follow symlinks, so this PR has no effect, but it avoids expensive `isDir` call and makes the condition more correct. Commits ------- 621f75f fix children cond
2 parents 9cbdfc6 + 621f75f commit 9c1dedb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct(\Iterator $iterator, array $directories)
5959
#[\ReturnTypeWillChange]
6060
public function accept()
6161
{
62-
if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) {
62+
if (isset($this->excludedDirs[$this->getFilename()]) && $this->hasChildren()) {
6363
return false;
6464
}
6565

0 commit comments

Comments
 (0)
0