File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 44
55use Symfony \Component \Finder \Finder ;
66use function array_filter ;
7+ use function array_map ;
78use function array_unique ;
89use function array_values ;
910use function file_exists ;
@@ -34,24 +35,27 @@ public function findFiles(array $paths): FileFinderResult
3435 $ files = [];
3536 foreach ($ paths as $ path ) {
3637 if (is_file ($ path )) {
37- $ files [] = $ this -> fileHelper -> normalizePath ( $ path) ;
38+ $ files [] = $ path ;
3839 } elseif (!file_exists ($ path )) {
3940 throw new PathNotFoundException ($ path );
4041 } else {
4142 $ finder = new Finder ();
4243 $ finder ->followLinks ();
4344 foreach ($ finder ->files ()->name ('*.{ ' . implode (', ' , $ this ->fileExtensions ) . '} ' )->in ($ path ) as $ fileInfo ) {
44- $ files [] = $ this -> fileHelper -> normalizePath ( $ fileInfo ->getPathname () );
45+ $ files [] = $ fileInfo ->getPathname ();
4546 $ onlyFiles = false ;
4647 }
4748 }
4849 }
4950
50- $ files = array_values ( array_unique ( array_filter ($ files , fn (string $ file ): bool => !$ this ->fileExcluder ->isExcludedFromAnalysing ($ file)) ));
51+ $ files = array_filter ($ files , fn (string $ file ): bool => !$ this ->fileExcluder ->isExcludedFromAnalysing ($ file ));
5152
5253 sort ($ files );
5354
54- return new FileFinderResult ($ files , $ onlyFiles );
55+ return new FileFinderResult (
56+ array_values (array_unique (array_map (fn (string $ file ): string => $ this ->fileHelper ->normalizePath ($ file ), $ files ))),
57+ $ onlyFiles ,
58+ );
5559 }
5660
5761}
You can’t perform that action at this time.
0 commit comments