mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
Updated Rector to commit 0ff50c06d0c90ed0a678fd56261ab40b25f8b29f
0ff50c06d0
[Reflection] Reduce Scope pulling on ReflectionResolver (#4548)
This commit is contained in:
parent
2056f7b2b8
commit
78d51cc3eb
@ -105,7 +105,7 @@ CODE_SAMPLE
|
||||
if ($classMethod->getAttribute(self::HAS_SWAPPED_PARAMS, \false) === \true) {
|
||||
return null;
|
||||
}
|
||||
$classMethodReflection = $this->reflectionResolver->resolveMethodReflectionFromClassMethod($classMethod);
|
||||
$classMethodReflection = $this->reflectionResolver->resolveMethodReflectionFromClassMethod($classMethod, $scope);
|
||||
if (!$classMethodReflection instanceof MethodReflection) {
|
||||
return null;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ CODE_SAMPLE
|
||||
if ($this->shouldSkip($methodName, $className, $node, $scope)) {
|
||||
return null;
|
||||
}
|
||||
if ($this->isInstantiable($className)) {
|
||||
if ($this->isInstantiable($className, $scope)) {
|
||||
$new = new New_($node->class);
|
||||
return new MethodCall($new, $node->name, $node->args);
|
||||
}
|
||||
@ -175,12 +175,12 @@ CODE_SAMPLE
|
||||
$parentClassName = $this->parentClassScopeResolver->resolveParentClassName($scope);
|
||||
return $className === $parentClassName;
|
||||
}
|
||||
private function isInstantiable(string $className) : bool
|
||||
private function isInstantiable(string $className, Scope $scope) : bool
|
||||
{
|
||||
if (!$this->reflectionProvider->hasClass($className)) {
|
||||
return \false;
|
||||
}
|
||||
$methodReflection = $this->reflectionResolver->resolveMethodReflection($className, '__callStatic', null);
|
||||
$methodReflection = $this->reflectionResolver->resolveMethodReflection($className, '__callStatic', $scope);
|
||||
if ($methodReflection instanceof MethodReflection) {
|
||||
return \false;
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'f77e355f95de5ca8ac256bc975418ba498e72a57';
|
||||
public const PACKAGE_VERSION = '0ff50c06d0c90ed0a678fd56261ab40b25f8b29f';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-07-20 07:24:56';
|
||||
public const RELEASE_DATE = '2023-07-20 14:39:16';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -192,15 +192,14 @@ final class ReflectionResolver
|
||||
}
|
||||
return $this->resolveFunctionReflectionFromFuncCall($call);
|
||||
}
|
||||
public function resolveMethodReflectionFromClassMethod(ClassMethod $classMethod) : ?MethodReflection
|
||||
public function resolveMethodReflectionFromClassMethod(ClassMethod $classMethod, Scope $scope) : ?MethodReflection
|
||||
{
|
||||
$classReflection = $this->resolveClassReflection($classMethod);
|
||||
$classReflection = $scope->getClassReflection();
|
||||
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);
|
||||
}
|
||||
public function resolveMethodReflectionFromNew(New_ $new) : ?MethodReflection
|
||||
|
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 ComposerAutoloaderInit0088ec8d10e5e688125c7ee39ebb088d::getLoader();
|
||||
return ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392::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 ComposerAutoloaderInit0088ec8d10e5e688125c7ee39ebb088d
|
||||
class ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit0088ec8d10e5e688125c7ee39ebb088d
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit0088ec8d10e5e688125c7ee39ebb088d', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit0088ec8d10e5e688125c7ee39ebb088d', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit177a1ab00f34054189b1b5f702c32392::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$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 ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d
|
||||
class ComposerStaticInit177a1ab00f34054189b1b5f702c32392
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3023,9 +3023,9 @@ class ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit0088ec8d10e5e688125c7ee39ebb088d::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user