Skip to content

Commit

Permalink
uses Finder 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jan 18, 2023
1 parent 0a6ff85 commit 2e60d84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"require": {
"php": ">=8.0 <8.3",
"ext-tokenizer": "*",
"nette/finder": "^2.5 || ^3.0",
"nette/utils": "^3.0"
"nette/utils": "^4.0"
},
"require-dev": {
"nette/tester": "^2.4",
Expand Down
6 changes: 3 additions & 3 deletions src/RobotLoader/RobotLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ private function createFileIterator(string $dir): Nette\Utils\Finder
}
}

return Nette\Utils\Finder::findFiles(...$this->acceptFiles)
return Nette\Utils\Finder::findFiles($this->acceptFiles)
->filter($filter = function (SplFileInfo $file) use ($disallow) {
return $file->getRealPath() === false
? true
: !isset($disallow[str_replace('\\', '/', $file->getRealPath())]);
})
->descentFilter($filter)
->from($dir)
->exclude(...$this->ignoreDirs)
->filter($filter);
->exclude($this->ignoreDirs);
}


Expand Down

0 comments on commit 2e60d84

Please sign in to comment.