Skip to content

Commit

Permalink
fix: fix file finder error on iter sub-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 13, 2022
1 parent 5d534e2 commit 73b2877
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FileFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ private function findInDirectory(string $dir): Iterator
private string $directorySep = '/';
private bool $skipUnreadableDirs;

public function __construct(string $path, int $flags, bool $recursive, bool $skipUnreadableDirs = true)
public function __construct(string $path, int $flags, bool $recursive = true, bool $skipUnreadableDirs = true)
{
if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) {
throw new RuntimeException('This iterator only support returning current as fileInfo.');
Expand Down Expand Up @@ -733,6 +733,7 @@ public function getChildren(): RecursiveDirectoryIterator
{
try {
$children = parent::getChildren();

if ($children instanceof self) {
$children->rootPath = $this->rootPath;
$children->rewindable = &$this->rewindable;
Expand Down

0 comments on commit 73b2877

Please sign in to comment.