Skip to content

Commit

Permalink
Updated Rector to commit 81e8c74b0ea2a107db681ee21c13925837b84abc
Browse files Browse the repository at this point in the history
rectorphp/rector-src@81e8c74 [NodeManipulator] Use ReflectionResolver instead of BetterNodeFinder parent lookup on ClassMethodManipulator (#4035)
  • Loading branch information
TomasVotruba committed May 31, 2023
1 parent a31c14f commit b655a25
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel/RectorKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
15 changes: 4 additions & 11 deletions src/NodeManipulator/ClassMethodManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@
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
Expand All @@ -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;
}
Expand All @@ -38,14 +31,14 @@ public function isNamedConstructor(ClassMethod $classMethod) : bool
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();
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d::getLoader();
return ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit731739b266fe641fa1d637c18a956e3d
class ComposerAutoloaderInit79d6ac6df0b20288ba3e1e8745c6e242
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
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;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit731739b266fe641fa1d637c18a956e3d
class ComposerStaticInit79d6ac6df0b20288ba3e1e8745c6e242
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit b655a25

Please sign in to comment.