Skip to content

Commit

Permalink
[DX] Remove double call $configuration->getFileExtensions() on FileFa…
Browse files Browse the repository at this point in the history
…ctory (#4851)
  • Loading branch information
samsonasik committed Aug 25, 2023
1 parent a2c2046 commit 2013382
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ValueObjectFactory/Application/FileFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ public function findFilesInPaths(array $paths, Configuration $configuration): ar
$supportedFileExtensions = $configuration->getFileExtensions();
$filePaths = $this->filesFinder->findInDirectoriesAndFiles($paths, $supportedFileExtensions);

$fileExtensions = $configuration->getFileExtensions();
$fileWithExtensionsFilter = static function (string $filePath) use ($fileExtensions): bool {
$fileWithExtensionsFilter = static function (string $filePath) use ($supportedFileExtensions): bool {
$filePathExtension = pathinfo($filePath, PATHINFO_EXTENSION);
return in_array($filePathExtension, $fileExtensions, true);
return in_array($filePathExtension, $supportedFileExtensions, true);
};

return array_filter($filePaths, $fileWithExtensionsFilter);
Expand Down

0 comments on commit 2013382

Please sign in to comment.