Updated Rector to commit 8e1db4dad04d4abcbc36e8e8ddc58cc007877733

8e1db4dad0 [Ast] Improve AstResolver and ClassLikeAstResolver performance (#3714)
This commit is contained in:
Tomas Votruba 2023-04-30 04:05:26 +00:00
parent 4a2e921404
commit d8e30d57b8
6 changed files with 16 additions and 16 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'c3aca95a7d1281beee8850ae001952760cce6658';
public const PACKAGE_VERSION = '8e1db4dad04d4abcbc36e8e8ddc58cc007877733';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-04-30 09:30:11';
public const RELEASE_DATE = '2023-04-30 04:01:15';
/**
* @var int
*/

View File

@ -113,8 +113,6 @@ final class AstResolver
public function resolveClassMethodFromMethodReflection(MethodReflection $methodReflection) : ?ClassMethod
{
$classReflection = $methodReflection->getDeclaringClass();
$classLikeName = $classReflection->getName();
$methodName = $methodReflection->getName();
$fileName = $classReflection->getFileName();
// probably native PHP method → un-parseable
if ($fileName === null) {
@ -124,6 +122,8 @@ final class AstResolver
if ($nodes === []) {
return null;
}
$classLikeName = $classReflection->getName();
$methodName = $methodReflection->getName();
$classMethod = null;
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($nodes, function (Node $node) use($classLikeName, $methodName, &$classMethod) : ?int {
if (!$node instanceof ClassLike) {
@ -155,7 +155,6 @@ final class AstResolver
}
public function resolveFunctionFromFunctionReflection(FunctionReflection $functionReflection) : ?Function_
{
$functionName = $functionReflection->getName();
$fileName = $functionReflection->getFileName();
if ($fileName === null) {
return null;
@ -164,6 +163,7 @@ final class AstResolver
if ($nodes === []) {
return null;
}
$functionName = $functionReflection->getName();
$functionNode = null;
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($nodes, function (Node $node) use($functionName, &$functionNode) : ?int {
if (!$node instanceof Function_) {

View File

@ -49,7 +49,6 @@ final class ClassLikeAstResolver
if ($classReflection->isBuiltin()) {
return null;
}
$className = $classReflection->getName();
$fileName = $classReflection->getFileName();
// probably internal class
if ($fileName === null) {
@ -59,6 +58,7 @@ final class ClassLikeAstResolver
if ($stmts === []) {
return null;
}
$className = $classReflection->getName();
/** @var Class_|Trait_|Interface_|Enum_|null $classLike */
$classLike = $this->betterNodeFinder->findFirst($stmts, function (Node $node) use($className) : bool {
if (!$node instanceof ClassLike) {

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInita83d01ab291c56a79faed0c7e78fc6f0::getLoader();
return ComposerAutoloaderInitac3283dcf4a6811c3f87113b7b35eb70::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInita83d01ab291c56a79faed0c7e78fc6f0
class ComposerAutoloaderInitac3283dcf4a6811c3f87113b7b35eb70
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInita83d01ab291c56a79faed0c7e78fc6f0
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInita83d01ab291c56a79faed0c7e78fc6f0', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitac3283dcf4a6811c3f87113b7b35eb70', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInita83d01ab291c56a79faed0c7e78fc6f0', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitac3283dcf4a6811c3f87113b7b35eb70', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitac3283dcf4a6811c3f87113b7b35eb70::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitac3283dcf4a6811c3f87113b7b35eb70::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0
class ComposerStaticInitac3283dcf4a6811c3f87113b7b35eb70
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3152,9 +3152,9 @@ class ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita83d01ab291c56a79faed0c7e78fc6f0::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitac3283dcf4a6811c3f87113b7b35eb70::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitac3283dcf4a6811c3f87113b7b35eb70::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitac3283dcf4a6811c3f87113b7b35eb70::$classMap;
}, null, ClassLoader::class);
}