Skip to content

Commit

Permalink
FileFinder - make list of found files unique
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 15, 2023
1 parent 18a6723 commit 7491260
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/File/FileFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Symfony\Component\Finder\Finder;
use function array_filter;
use function array_unique;
use function array_values;
use function file_exists;
use function implode;
Expand Down Expand Up @@ -45,7 +46,7 @@ public function findFiles(array $paths): FileFinderResult
}
}

$files = array_values(array_filter($files, fn (string $file): bool => !$this->fileExcluder->isExcludedFromAnalysing($file)));
$files = array_values(array_unique(array_filter($files, fn (string $file): bool => !$this->fileExcluder->isExcludedFromAnalysing($file))));

return new FileFinderResult($files, $onlyFiles);
}
Expand Down

0 comments on commit 7491260

Please sign in to comment.