mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit f7b43d4565fb27cf53c77a86bf7d4afd8f5a556f
f7b43d4565
Performance: Prevent sorting of files in PhpFilesFinder (#4164)
This commit is contained in:
parent
665558472d
commit
c718a1c775
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '3d31e31f3a4452a52a5b2bdd393d90e07b84e8a6';
|
||||
public const PACKAGE_VERSION = 'f7b43d4565fb27cf53c77a86bf7d4afd8f5a556f';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-11 15:52:30';
|
||||
public const RELEASE_DATE = '2023-06-11 16:32:09';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -45,25 +45,28 @@ final class FilesFinder
|
||||
* @param string[] $suffixes
|
||||
* @return string[]
|
||||
*/
|
||||
public function findInDirectoriesAndFiles(array $source, array $suffixes = []) : array
|
||||
public function findInDirectoriesAndFiles(array $source, array $suffixes = [], bool $sortByName = \true) : array
|
||||
{
|
||||
$filesAndDirectories = $this->filesystemTweaker->resolveWithFnmatch($source);
|
||||
$filePaths = $this->fileAndDirectoryFilter->filterFiles($filesAndDirectories);
|
||||
$directories = $this->fileAndDirectoryFilter->filterDirectories($filesAndDirectories);
|
||||
$currentAndDependentFilePaths = $this->unchangedFilesFilter->filterAndJoinWithDependentFileInfos($filePaths);
|
||||
return \array_merge($currentAndDependentFilePaths, $this->findInDirectories($directories, $suffixes));
|
||||
return \array_merge($currentAndDependentFilePaths, $this->findInDirectories($directories, $suffixes, $sortByName));
|
||||
}
|
||||
/**
|
||||
* @param string[] $directories
|
||||
* @param string[] $suffixes
|
||||
* @return string[]
|
||||
*/
|
||||
private function findInDirectories(array $directories, array $suffixes) : array
|
||||
private function findInDirectories(array $directories, array $suffixes, bool $sortByName = \true) : array
|
||||
{
|
||||
if ($directories === []) {
|
||||
return [];
|
||||
}
|
||||
$finder = Finder::create()->files()->size('> 0')->in($directories)->sortByName();
|
||||
$finder = Finder::create()->files()->size('> 0')->in($directories);
|
||||
if ($sortByName) {
|
||||
$finder->sortByName();
|
||||
}
|
||||
if ($suffixes !== []) {
|
||||
$suffixesPattern = $this->normalizeSuffixesToPattern($suffixes);
|
||||
$finder->name($suffixesPattern);
|
||||
|
@ -27,7 +27,7 @@ final class PhpFilesFinder
|
||||
*/
|
||||
public function findInPaths(array $paths) : array
|
||||
{
|
||||
$filePaths = $this->filesFinder->findInDirectoriesAndFiles($paths, ['php']);
|
||||
$filePaths = $this->filesFinder->findInDirectoriesAndFiles($paths, ['php'], \false);
|
||||
// filter out non-PHP files
|
||||
foreach ($filePaths as $key => $filePath) {
|
||||
/**
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit988fc8aaba1b0fbe2ae64550058a1c43::getLoader();
|
||||
return ComposerAutoloaderInit1b852f0e8d373a095568827d71f67799::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit988fc8aaba1b0fbe2ae64550058a1c43
|
||||
class ComposerAutoloaderInit1b852f0e8d373a095568827d71f67799
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit988fc8aaba1b0fbe2ae64550058a1c43
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit988fc8aaba1b0fbe2ae64550058a1c43', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit1b852f0e8d373a095568827d71f67799', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit988fc8aaba1b0fbe2ae64550058a1c43', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit1b852f0e8d373a095568827d71f67799', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit1b852f0e8d373a095568827d71f67799::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit1b852f0e8d373a095568827d71f67799::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43
|
||||
class ComposerStaticInit1b852f0e8d373a095568827d71f67799
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3127,9 +3127,9 @@ class ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit988fc8aaba1b0fbe2ae64550058a1c43::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit1b852f0e8d373a095568827d71f67799::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit1b852f0e8d373a095568827d71f67799::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit1b852f0e8d373a095568827d71f67799::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user