Skip to content

Commit

Permalink
Add real path to filePaths when not false (#3004)
Browse files Browse the repository at this point in the history
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
  • Loading branch information
jamwid07 and samsonasik committed Oct 21, 2022
1 parent 4cecebf commit befc544
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/FileSystem/FilesFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ private function findInDirectories(array $directories, array $suffixes): array

$filePaths = [];
foreach ($finder as $fileInfo) {
$filePaths[] = $fileInfo->getRealPath();
// getRealPath() function will return false when it checks broken symlinks.
// So we should check if this file exists or we got broken symlink

/** @var string|false $path */
$path = $fileInfo->getRealPath();
if ($path !== false) {
$filePaths[] = $path;
}
}

return $this->unchangedFilesFilter->filterAndJoinWithDependentFileInfos($filePaths);
Expand Down

0 comments on commit befc544

Please sign in to comment.