From 971a0d2b75f56a8988fcd8276ca430adbe1ad2ed Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 11 Jun 2023 05:45:51 +0000 Subject: [PATCH] Updated Rector to commit ea2ee121e0b6388fdcda0125f7dca941a44edc3a https://github.com/rectorphp/rector-src/commit/ea2ee121e0b6388fdcda0125f7dca941a44edc3a [Reflection] Remove parent lookup on ReflectionResolver (#4169) --- src/Application/VersionResolver.php | 4 ++-- src/Kernel/RectorKernel.php | 2 +- src/Reflection/ReflectionResolver.php | 18 ++++-------------- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 6 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 50b0723fbce..8b20345026d 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'd541d1a77e5e140bf12d4b71c9c9f98a3852a366'; + public const PACKAGE_VERSION = 'ea2ee121e0b6388fdcda0125f7dca941a44edc3a'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-06-11 00:36:07'; + public const RELEASE_DATE = '2023-06-11 12:42:01'; /** * @var int */ diff --git a/src/Kernel/RectorKernel.php b/src/Kernel/RectorKernel.php index c75beaa8da2..3619708b3fc 100644 --- a/src/Kernel/RectorKernel.php +++ b/src/Kernel/RectorKernel.php @@ -15,7 +15,7 @@ final class RectorKernel /** * @var string */ - private const CACHE_KEY = 'v89'; + private const CACHE_KEY = 'v90'; /** * @var \Symfony\Component\DependencyInjection\ContainerInterface|null */ diff --git a/src/Reflection/ReflectionResolver.php b/src/Reflection/ReflectionResolver.php index 099876032c6..44f81f95c3d 100644 --- a/src/Reflection/ReflectionResolver.php +++ b/src/Reflection/ReflectionResolver.php @@ -25,7 +25,6 @@ use PHPStan\Type\TypeWithClassName; use Rector\Core\Exception\ShouldNotHappenException; use Rector\Core\NodeAnalyzer\ClassAnalyzer; use Rector\Core\PhpParser\AstResolver; -use Rector\Core\PhpParser\Node\BetterNodeFinder; use Rector\Core\PHPStan\Reflection\TypeToCallReflectionResolver\TypeToCallReflectionResolverRegistry; use Rector\Core\ValueObject\MethodName; use Rector\NodeNameResolver\NodeNameResolver; @@ -40,11 +39,6 @@ final class ReflectionResolver * @var \PHPStan\Reflection\ReflectionProvider */ private $reflectionProvider; - /** - * @readonly - * @var \Rector\Core\PhpParser\Node\BetterNodeFinder - */ - private $betterNodeFinder; /** * @readonly * @var \Rector\NodeTypeResolver\NodeTypeResolver @@ -69,10 +63,9 @@ final class ReflectionResolver * @var \Rector\Core\PhpParser\AstResolver */ private $astResolver; - public function __construct(ReflectionProvider $reflectionProvider, BetterNodeFinder $betterNodeFinder, NodeTypeResolver $nodeTypeResolver, NodeNameResolver $nodeNameResolver, TypeToCallReflectionResolverRegistry $typeToCallReflectionResolverRegistry, ClassAnalyzer $classAnalyzer) + public function __construct(ReflectionProvider $reflectionProvider, NodeTypeResolver $nodeTypeResolver, NodeNameResolver $nodeNameResolver, TypeToCallReflectionResolverRegistry $typeToCallReflectionResolverRegistry, ClassAnalyzer $classAnalyzer) { $this->reflectionProvider = $reflectionProvider; - $this->betterNodeFinder = $betterNodeFinder; $this->nodeTypeResolver = $nodeTypeResolver; $this->nodeNameResolver = $nodeNameResolver; $this->typeToCallReflectionResolverRegistry = $typeToCallReflectionResolverRegistry; @@ -201,14 +194,11 @@ final class ReflectionResolver } public function resolveMethodReflectionFromClassMethod(ClassMethod $classMethod) : ?MethodReflection { - $classLike = $this->betterNodeFinder->findParentType($classMethod, ClassLike::class); - if (!$classLike instanceof ClassLike) { - return null; - } - $className = $this->nodeNameResolver->getName($classLike); - if (!\is_string($className)) { + $classReflection = $this->resolveClassReflection($classMethod); + if (!$classReflection instanceof ClassReflection) { return null; } + $className = $classReflection->getName(); $methodName = $this->nodeNameResolver->getName($classMethod); $scope = $classMethod->getAttribute(AttributeKey::SCOPE); return $this->resolveMethodReflection($className, $methodName, $scope); diff --git a/vendor/autoload.php b/vendor/autoload.php index eea89c51fbc..6242d039315 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitd3d078f7b7ac5bab00694b4144be9d9b::getLoader(); +return ComposerAutoloaderInit2a46dd31cd0649b8ab5689ec3d5eed81::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index defde362047..566bf53513d 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitd3d078f7b7ac5bab00694b4144be9d9b +class ComposerAutoloaderInit2a46dd31cd0649b8ab5689ec3d5eed81 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInitd3d078f7b7ac5bab00694b4144be9d9b return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitd3d078f7b7ac5bab00694b4144be9d9b', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit2a46dd31cd0649b8ab5689ec3d5eed81', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitd3d078f7b7ac5bab00694b4144be9d9b', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit2a46dd31cd0649b8ab5689ec3d5eed81', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit2a46dd31cd0649b8ab5689ec3d5eed81::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit2a46dd31cd0649b8ab5689ec3d5eed81::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 83ad7d47be1..d069b8cfdea 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b +class ComposerStaticInit2a46dd31cd0649b8ab5689ec3d5eed81 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3127,9 +3127,9 @@ class ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitd3d078f7b7ac5bab00694b4144be9d9b::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit2a46dd31cd0649b8ab5689ec3d5eed81::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit2a46dd31cd0649b8ab5689ec3d5eed81::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit2a46dd31cd0649b8ab5689ec3d5eed81::$classMap; }, null, ClassLoader::class); }