mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit 5e1601086d921c549fc28f69ac32ec127c2c47b0
5e1601086d
[Performance] Use direct BetterNodeFinder::find() on LocalMethodCallFinder::match() (#4287)
This commit is contained in:
parent
7c4692b3bb
commit
e064418688
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '1afeeb91592de9e2738f179c5d7ad82533bf5042';
|
||||
public const PACKAGE_VERSION = '5e1601086d921c549fc28f69ac32ec127c2c47b0';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-19 15:53:55';
|
||||
public const RELEASE_DATE = '2023-06-19 23:05:05';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\PhpParser\NodeFinder;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
@ -42,23 +43,21 @@ final class LocalMethodCallFinder
|
||||
if (!\is_string($className)) {
|
||||
return [];
|
||||
}
|
||||
/** @var MethodCall[] $methodCalls */
|
||||
$methodCalls = $this->betterNodeFinder->findInstanceOf($class->getMethods(), MethodCall::class);
|
||||
$classMethodName = $this->nodeNameResolver->getName($classMethod);
|
||||
$matchingMethodCalls = [];
|
||||
foreach ($methodCalls as $methodCall) {
|
||||
if (!$this->nodeNameResolver->isName($methodCall->name, $classMethodName)) {
|
||||
continue;
|
||||
/** @var MethodCall[] $matchingMethodCalls */
|
||||
$matchingMethodCalls = $this->betterNodeFinder->find($class->getMethods(), function (Node $subNode) use($className, $classMethodName) : bool {
|
||||
if (!$subNode instanceof MethodCall) {
|
||||
return \false;
|
||||
}
|
||||
$callerType = $this->nodeTypeResolver->getType($methodCall->var);
|
||||
if (!$this->nodeNameResolver->isName($subNode->name, $classMethodName)) {
|
||||
return \false;
|
||||
}
|
||||
$callerType = $this->nodeTypeResolver->getType($subNode->var);
|
||||
if (!$callerType instanceof TypeWithClassName) {
|
||||
continue;
|
||||
return \false;
|
||||
}
|
||||
if ($callerType->getClassName() !== $className) {
|
||||
continue;
|
||||
}
|
||||
$matchingMethodCalls[] = $methodCall;
|
||||
}
|
||||
return $callerType->getClassName() === $className;
|
||||
});
|
||||
return $matchingMethodCalls;
|
||||
}
|
||||
}
|
||||
|
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 ComposerAutoloaderInitac162127ef3327a5106e16a48bf29b60::getLoader();
|
||||
return ComposerAutoloaderInitf3544180700689daaf43dc275bc0eb53::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 ComposerAutoloaderInitac162127ef3327a5106e16a48bf29b60
|
||||
class ComposerAutoloaderInitf3544180700689daaf43dc275bc0eb53
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInitac162127ef3327a5106e16a48bf29b60
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitac162127ef3327a5106e16a48bf29b60', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitf3544180700689daaf43dc275bc0eb53', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitac162127ef3327a5106e16a48bf29b60', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitf3544180700689daaf43dc275bc0eb53', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitac162127ef3327a5106e16a48bf29b60::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitf3544180700689daaf43dc275bc0eb53::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitac162127ef3327a5106e16a48bf29b60::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitf3544180700689daaf43dc275bc0eb53::$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 ComposerStaticInitac162127ef3327a5106e16a48bf29b60
|
||||
class ComposerStaticInitf3544180700689daaf43dc275bc0eb53
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3095,9 +3095,9 @@ class ComposerStaticInitac162127ef3327a5106e16a48bf29b60
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitac162127ef3327a5106e16a48bf29b60::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitac162127ef3327a5106e16a48bf29b60::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitac162127ef3327a5106e16a48bf29b60::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitf3544180700689daaf43dc275bc0eb53::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitf3544180700689daaf43dc275bc0eb53::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitf3544180700689daaf43dc275bc0eb53::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user