mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Updated Rector to commit 81e8c74b0ea2a107db681ee21c13925837b84abc
81e8c74b0e
[NodeManipulator] Use ReflectionResolver instead of BetterNodeFinder parent lookup on ClassMethodManipulator (#4035)
This commit is contained in:
parent
a31c14f083
commit
b655a25951
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '98fa6b51c4114010cb45c7f07ad96256430bf605';
|
||||
public const PACKAGE_VERSION = '81e8c74b0ea2a107db681ee21c13925837b84abc';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-05-31 13:13:35';
|
||||
public const RELEASE_DATE = '2023-05-31 13:15:27';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -15,7 +15,7 @@ final class RectorKernel
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const CACHE_KEY = 'v42';
|
||||
private const CACHE_KEY = 'v43';
|
||||
/**
|
||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
|
||||
*/
|
||||
|
@ -6,17 +6,11 @@ namespace Rector\Core\NodeManipulator;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\Core\Reflection\ReflectionResolver;
|
||||
use Rector\Core\ValueObject\MethodName;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
final class ClassMethodManipulator
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
@ -27,9 +21,8 @@ final class ClassMethodManipulator
|
||||
* @var \Rector\Core\Reflection\ReflectionResolver
|
||||
*/
|
||||
private $reflectionResolver;
|
||||
public function __construct(BetterNodeFinder $betterNodeFinder, NodeNameResolver $nodeNameResolver, ReflectionResolver $reflectionResolver)
|
||||
public function __construct(NodeNameResolver $nodeNameResolver, ReflectionResolver $reflectionResolver)
|
||||
{
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->reflectionResolver = $reflectionResolver;
|
||||
}
|
||||
@ -38,14 +31,14 @@ final class ClassMethodManipulator
|
||||
if (!$this->nodeNameResolver->isName($classMethod, MethodName::CONSTRUCT)) {
|
||||
return \false;
|
||||
}
|
||||
$class = $this->betterNodeFinder->findParentType($classMethod, Class_::class);
|
||||
if (!$class instanceof Class_) {
|
||||
$classReflection = $this->reflectionResolver->resolveClassReflection($classMethod);
|
||||
if (!$classReflection instanceof ClassReflection) {
|
||||
return \false;
|
||||
}
|
||||
if ($classMethod->isPrivate()) {
|
||||
return \true;
|
||||
}
|
||||
if ($class->isFinal()) {
|
||||
if ($classReflection->isFinalByKeyword()) {
|
||||
return \false;
|
||||
}
|
||||
return $classMethod->isProtected();
|
||||
|
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 ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d::getLoader();
|
||||
return ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242::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 ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d
|
||||
class ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit731739b266fe641fa1d637c18a956e3d::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$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 ComposerStaticInit731739b266fe641fa1d637c18a956e3d
|
||||
class ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3062,9 +3062,9 @@ class ComposerStaticInit731739b266fe641fa1d637c18a956e3d
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit731739b266fe641fa1d637c18a956e3d::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user