mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 38d716ecec295b96a94cc2db9b3091fc1ca0ea94
38d716ecec
[Performance] Remove duplicate filter extension files on FilesFinder (#5463)
This commit is contained in:
parent
455fba49f9
commit
35bb56366b
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '9d310ce5daca61f51f35e3c8755a442998f1c536';
|
||||
public const PACKAGE_VERSION = '38d716ecec295b96a94cc2db9b3091fc1ca0ea94';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-13 09:41:12';
|
||||
public const RELEASE_DATE = '2024-01-14 02:14:03';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -50,6 +50,13 @@ final class FilesFinder
|
|||
$filePaths = \array_filter($filePaths, function (string $filePath) : bool {
|
||||
return !$this->pathSkipper->shouldSkip($filePath);
|
||||
});
|
||||
if ($suffixes !== []) {
|
||||
$fileWithExtensionsFilter = static function (string $filePath) use($suffixes) : bool {
|
||||
$filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION);
|
||||
return \in_array($filePathExtension, $suffixes, \true);
|
||||
};
|
||||
$filePaths = \array_filter($filePaths, $fileWithExtensionsFilter);
|
||||
}
|
||||
$currentAndDependentFilePaths = $this->unchangedFilesFilter->filterFileInfos($filePaths);
|
||||
$directories = $this->fileAndDirectoryFilter->filterDirectories($filesAndDirectories);
|
||||
return \array_merge($currentAndDependentFilePaths, $this->findInDirectories($directories, $suffixes, $sortByName));
|
||||
|
|
|
@ -36,11 +36,6 @@ final class FileFactory
|
|||
$this->changedFilesDetector->clear();
|
||||
}
|
||||
$supportedFileExtensions = $configuration->getFileExtensions();
|
||||
$filePaths = $this->filesFinder->findInDirectoriesAndFiles($paths, $supportedFileExtensions);
|
||||
$fileWithExtensionsFilter = static function (string $filePath) use($supportedFileExtensions) : bool {
|
||||
$filePathExtension = \pathinfo($filePath, \PATHINFO_EXTENSION);
|
||||
return \in_array($filePathExtension, $supportedFileExtensions, \true);
|
||||
};
|
||||
return \array_filter($filePaths, $fileWithExtensionsFilter);
|
||||
return $this->filesFinder->findInDirectoriesAndFiles($paths, $supportedFileExtensions);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue