Skip to content

Commit 73b2877

Browse files
committed
fix: fix file finder error on iter sub-dir
1 parent 5d534e2 commit 73b2877

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/FileFinder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ private function findInDirectory(string $dir): Iterator
682682
private string $directorySep = '/';
683683
private bool $skipUnreadableDirs;
684684

685-
public function __construct(string $path, int $flags, bool $recursive, bool $skipUnreadableDirs = true)
685+
public function __construct(string $path, int $flags, bool $recursive = true, bool $skipUnreadableDirs = true)
686686
{
687687
if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
688688
throw new RuntimeException('This iterator only support returning current as fileInfo.');
@@ -733,6 +733,7 @@ public function getChildren(): RecursiveDirectoryIterator
733733
{
734734
try {
735735
$children = parent::getChildren();
736+
736737
if ($children instanceof self) {
737738
$children->rootPath = $this->rootPath;
738739
$children->rewindable = &$this->rewindable;

0 commit comments

Comments
 (0)