mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-31 12:42:05 +01:00
Updated Rector to commit e55d6b32a785bd03635fffc9093e26e61e33d67c
e55d6b32a7
[CodeQuality] Reduce parent lookup for inside Closure Bind (#4230)
This commit is contained in:
parent
80c1bd777e
commit
6380eb68ac
@ -15,12 +15,14 @@ use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Function_;
|
||||
use PhpParser\NodeTraverser;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Type\MixedType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\CodeQuality\TypeResolver\ArrayDimFetchTypeResolver;
|
||||
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\NodeTypeResolver;
|
||||
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
|
||||
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
|
||||
@ -170,14 +172,11 @@ final class LocalPropertyAnalyzer
|
||||
*/
|
||||
private function isPartOfClosureBind(PropertyFetch $propertyFetch) : bool
|
||||
{
|
||||
$parentStaticCall = $this->betterNodeFinder->findParentType($propertyFetch, StaticCall::class);
|
||||
if (!$parentStaticCall instanceof StaticCall) {
|
||||
$scope = $propertyFetch->getAttribute(AttributeKey::SCOPE);
|
||||
if (!$scope instanceof Scope) {
|
||||
return \false;
|
||||
}
|
||||
if (!$this->nodeNameResolver->isName($parentStaticCall->class, 'Closure')) {
|
||||
return \true;
|
||||
}
|
||||
return $this->nodeNameResolver->isName($parentStaticCall->name, 'bind');
|
||||
return $scope->isInClosureBind();
|
||||
}
|
||||
private function isPartOfClosureBindTo(PropertyFetch $propertyFetch) : bool
|
||||
{
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '50abb40278c044835dbbbcd1f7aa105285b07b01';
|
||||
public const PACKAGE_VERSION = 'e55d6b32a785bd03635fffc9093e26e61e33d67c';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-14 15:51:26';
|
||||
public const RELEASE_DATE = '2023-06-14 21:54:26';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
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 ComposerAutoloaderInitc9b96215323d3c0ae0277f34ba05365d::getLoader();
|
||||
return ComposerAutoloaderInit641cd2222c3bcf7bd054fb9e39118952::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 ComposerAutoloaderInitc9b96215323d3c0ae0277f34ba05365d
|
||||
class ComposerAutoloaderInit641cd2222c3bcf7bd054fb9e39118952
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInitc9b96215323d3c0ae0277f34ba05365d
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc9b96215323d3c0ae0277f34ba05365d', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit641cd2222c3bcf7bd054fb9e39118952', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc9b96215323d3c0ae0277f34ba05365d', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit641cd2222c3bcf7bd054fb9e39118952', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit641cd2222c3bcf7bd054fb9e39118952::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit641cd2222c3bcf7bd054fb9e39118952::$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 ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d
|
||||
class ComposerStaticInit641cd2222c3bcf7bd054fb9e39118952
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3092,9 +3092,9 @@ class ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc9b96215323d3c0ae0277f34ba05365d::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit641cd2222c3bcf7bd054fb9e39118952::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit641cd2222c3bcf7bd054fb9e39118952::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit641cd2222c3bcf7bd054fb9e39118952::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user