Updated Rector to commit 48991c6394059d53256dcfacf41957f8a434a453

48991c6394 [Performance] Reduce ClassReflection lookup on RemoveUnusedPrivateMethodRector (#4006)
This commit is contained in:
Tomas Votruba 2023-05-28 21:08:58 +00:00
parent 45419321ce
commit 4cf0c8c8ba
5 changed files with 18 additions and 15 deletions

View File

@ -79,8 +79,12 @@ CODE_SAMPLE
return null;
}
$hasChanged = \false;
$classReflection = null;
foreach ($node->getMethods() as $classMethod) {
if ($this->shouldSkip($classMethod)) {
if (!$classReflection instanceof ClassReflection) {
$classReflection = $this->reflectionResolver->resolveClassReflection($classMethod);
}
if ($this->shouldSkip($classMethod, $classReflection)) {
continue;
}
if ($this->isClassMethodUsedAnalyzer->isClassMethodUsed($node, $classMethod, $scope)) {
@ -94,9 +98,8 @@ CODE_SAMPLE
}
return null;
}
private function shouldSkip(ClassMethod $classMethod) : bool
private function shouldSkip(ClassMethod $classMethod, ?ClassReflection $classReflection) : bool
{
$classReflection = $this->reflectionResolver->resolveClassReflection($classMethod);
if (!$classReflection instanceof ClassReflection) {
return \true;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '95d3dc93770718d2337a7addbfed021f6cad8072';
public const PACKAGE_VERSION = '48991c6394059d53256dcfacf41957f8a434a453';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-05-28 20:57:44';
public const RELEASE_DATE = '2023-05-28 21:05:00';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInita48636efdaad97e9d38262ad7a27c705::getLoader();
return ComposerAutoloaderInit0264165ab8ea163af0fab6ca3ae928ab::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInita48636efdaad97e9d38262ad7a27c705
class ComposerAutoloaderInit0264165ab8ea163af0fab6ca3ae928ab
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInita48636efdaad97e9d38262ad7a27c705
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInita48636efdaad97e9d38262ad7a27c705', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit0264165ab8ea163af0fab6ca3ae928ab', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInita48636efdaad97e9d38262ad7a27c705', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit0264165ab8ea163af0fab6ca3ae928ab', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInita48636efdaad97e9d38262ad7a27c705::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit0264165ab8ea163af0fab6ca3ae928ab::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInita48636efdaad97e9d38262ad7a27c705::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit0264165ab8ea163af0fab6ca3ae928ab::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInita48636efdaad97e9d38262ad7a27c705
class ComposerStaticInit0264165ab8ea163af0fab6ca3ae928ab
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3086,9 +3086,9 @@ class ComposerStaticInita48636efdaad97e9d38262ad7a27c705
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita48636efdaad97e9d38262ad7a27c705::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita48636efdaad97e9d38262ad7a27c705::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita48636efdaad97e9d38262ad7a27c705::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit0264165ab8ea163af0fab6ca3ae928ab::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0264165ab8ea163af0fab6ca3ae928ab::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0264165ab8ea163af0fab6ca3ae928ab::$classMap;
}, null, ClassLoader::class);
}