Updated Rector to commit 6bbeaa2ac32afb454605e7cb14a935fce8019658

6bbeaa2ac3 [Performance] Direct use BetterNodeFinder->find() in PropertyFetchFinder::findPropertyFetchesInClassLike() (#4285)
This commit is contained in:
Tomas Votruba 2023-06-19 15:47:03 +00:00
parent 6ea61fb33b
commit 7312de58c0
5 changed files with 24 additions and 26 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd9f02cadebe0cb3b9ec43be05e000805f31bcb18';
public const PACKAGE_VERSION = '6bbeaa2ac32afb454605e7cb14a935fce8019658';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-19 15:29:14';
public const RELEASE_DATE = '2023-06-19 22:42:59';
/**
* @var int
*/

View File

@ -138,22 +138,20 @@ final class PropertyFetchFinder
*/
private function findPropertyFetchesInClassLike($class, array $stmts, string $propertyName, bool $hasTrait) : array
{
/** @var PropertyFetch[] $propertyFetches */
$propertyFetches = $this->betterNodeFinder->findInstanceOf($stmts, PropertyFetch::class);
/** @var PropertyFetch[] $matchingPropertyFetches */
$matchingPropertyFetches = \array_filter($propertyFetches, function (PropertyFetch $propertyFetch) use($propertyName, $class, $hasTrait) : bool {
if ($this->isInAnonymous($propertyFetch, $class, $hasTrait)) {
/** @var PropertyFetch[]|StaticPropertyFetch[] $propertyFetches */
$propertyFetches = $this->betterNodeFinder->find($stmts, function (Node $subNode) use($class, $hasTrait, $propertyName) : bool {
if ($subNode instanceof PropertyFetch) {
if ($this->isInAnonymous($subNode, $class, $hasTrait)) {
return \false;
}
return $this->isNamePropertyNameEquals($propertyFetch, $propertyName, $class);
return $this->isNamePropertyNameEquals($subNode, $propertyName, $class);
}
if ($subNode instanceof StaticPropertyFetch) {
return $this->nodeNameResolver->isName($subNode->name, $propertyName);
}
return \false;
});
/** @var StaticPropertyFetch[] $staticPropertyFetches */
$staticPropertyFetches = $this->betterNodeFinder->findInstanceOf($stmts, StaticPropertyFetch::class);
/** @var StaticPropertyFetch[] $matchingStaticPropertyFetches */
$matchingStaticPropertyFetches = \array_filter($staticPropertyFetches, function (StaticPropertyFetch $staticPropertyFetch) use($propertyName) : bool {
return $this->nodeNameResolver->isName($staticPropertyFetch->name, $propertyName);
});
return \array_merge($matchingPropertyFetches, $matchingStaticPropertyFetches);
return $propertyFetches;
}
/**
* @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Trait_ $class

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388
class ComposerAutoloaderInit5e857c576186b03416131e11f5136782
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit5e857c576186b03416131e11f5136782', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit5e857c576186b03416131e11f5136782', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit5e857c576186b03416131e11f5136782::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit5e857c576186b03416131e11f5136782::$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 ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388
class ComposerStaticInit5e857c576186b03416131e11f5136782
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3095,9 +3095,9 @@ class ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit5e857c576186b03416131e11f5136782::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5e857c576186b03416131e11f5136782::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5e857c576186b03416131e11f5136782::$classMap;
}, null, ClassLoader::class);
}