mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit 6bbeaa2ac32afb454605e7cb14a935fce8019658
6bbeaa2ac3
[Performance] Direct use BetterNodeFinder->find() in PropertyFetchFinder::findPropertyFetchesInClassLike() (#4285)
This commit is contained in:
parent
6ea61fb33b
commit
7312de58c0
@ -19,12 +19,12 @@ final class VersionResolver
|
|||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = 'd9f02cadebe0cb3b9ec43be05e000805f31bcb18';
|
public const PACKAGE_VERSION = '6bbeaa2ac32afb454605e7cb14a935fce8019658';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2023-06-19 15:29:14';
|
public const RELEASE_DATE = '2023-06-19 22:42:59';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
@ -138,22 +138,20 @@ final class PropertyFetchFinder
|
|||||||
*/
|
*/
|
||||||
private function findPropertyFetchesInClassLike($class, array $stmts, string $propertyName, bool $hasTrait) : array
|
private function findPropertyFetchesInClassLike($class, array $stmts, string $propertyName, bool $hasTrait) : array
|
||||||
{
|
{
|
||||||
/** @var PropertyFetch[] $propertyFetches */
|
/** @var PropertyFetch[]|StaticPropertyFetch[] $propertyFetches */
|
||||||
$propertyFetches = $this->betterNodeFinder->findInstanceOf($stmts, PropertyFetch::class);
|
$propertyFetches = $this->betterNodeFinder->find($stmts, function (Node $subNode) use($class, $hasTrait, $propertyName) : bool {
|
||||||
/** @var PropertyFetch[] $matchingPropertyFetches */
|
if ($subNode instanceof PropertyFetch) {
|
||||||
$matchingPropertyFetches = \array_filter($propertyFetches, function (PropertyFetch $propertyFetch) use($propertyName, $class, $hasTrait) : bool {
|
if ($this->isInAnonymous($subNode, $class, $hasTrait)) {
|
||||||
if ($this->isInAnonymous($propertyFetch, $class, $hasTrait)) {
|
return \false;
|
||||||
return \false;
|
}
|
||||||
|
return $this->isNamePropertyNameEquals($subNode, $propertyName, $class);
|
||||||
}
|
}
|
||||||
return $this->isNamePropertyNameEquals($propertyFetch, $propertyName, $class);
|
if ($subNode instanceof StaticPropertyFetch) {
|
||||||
|
return $this->nodeNameResolver->isName($subNode->name, $propertyName);
|
||||||
|
}
|
||||||
|
return \false;
|
||||||
});
|
});
|
||||||
/** @var StaticPropertyFetch[] $staticPropertyFetches */
|
return $propertyFetches;
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Trait_ $class
|
* @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Trait_ $class
|
||||||
|
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';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388::getLoader();
|
return ComposerAutoloaderInit5e857c576186b03416131e11f5136782::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
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388
|
class ComposerAutoloaderInit5e857c576186b03416131e11f5136782
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInitfb519dab578b29f1a5f5109ca0a58388
|
|||||||
return self::$loader;
|
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__));
|
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';
|
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->setClassMapAuthoritative(true);
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInit5e857c576186b03416131e11f5136782::$files;
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$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;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388
|
class ComposerStaticInit5e857c576186b03416131e11f5136782
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||||
@ -3095,9 +3095,9 @@ class ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388
|
|||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInit5e857c576186b03416131e11f5136782::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInit5e857c576186b03416131e11f5136782::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInitfb519dab578b29f1a5f5109ca0a58388::$classMap;
|
$loader->classMap = ComposerStaticInit5e857c576186b03416131e11f5136782::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user