Skip to content

Commit

Permalink
uses variadics in Finder API
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 14, 2022
1 parent 37c6e31 commit 66c08e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/RobotLoader/RobotLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ private function createFileIterator(string $dir): Nette\Utils\Finder
$acceptFiles = preg_split('#[,\s]+#', $acceptFiles);
}

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

0 comments on commit 66c08e3

Please sign in to comment.