From 749126094d4ea84f770251dd41a277a46567b47e Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sun, 15 Oct 2023 11:40:49 +0200 Subject: [PATCH] FileFinder - make list of found files unique --- src/File/FileFinder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/File/FileFinder.php b/src/File/FileFinder.php index d549d9c2cc..6ca9db6ddd 100644 --- a/src/File/FileFinder.php +++ b/src/File/FileFinder.php @@ -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; @@ -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); }