mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Updated Rector to commit 33cfa4f7164c7b0d2c2922d4cd9f0ebdac43a5d9
33cfa4f716
[ReadWrite] Reduce parent lookup on ReadWritePropertyAnalyzer (#4277)
This commit is contained in:
parent
fe68d59192
commit
07222965c2
@ -188,6 +188,10 @@ final class AttributeKey
|
||||
* @var string
|
||||
*/
|
||||
public const IS_IN_LOOP = 'is_in_loop';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const IS_ISSET_VAR = 'is_isset_var';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
@ -7,6 +7,7 @@ use PhpParser\Node;
|
||||
use PhpParser\Node\Attribute;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Expr\ArrowFunction;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use PhpParser\Node\Stmt\Break_;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
@ -38,6 +39,11 @@ final class ContextNodeVisitor extends NodeVisitorAbstract implements ScopeResol
|
||||
$this->processContextInLoop($node);
|
||||
return null;
|
||||
}
|
||||
if ($node instanceof Isset_) {
|
||||
foreach ($node->vars as $var) {
|
||||
$var->setAttribute(AttributeKey::IS_ISSET_VAR, \true);
|
||||
}
|
||||
}
|
||||
if ($node instanceof Unset_) {
|
||||
foreach ($node->vars as $var) {
|
||||
$var->setAttribute(AttributeKey::IS_UNSET_VAR, \true);
|
||||
|
@ -8,10 +8,8 @@ use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\AssignOp;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\StaticPropertyFetch;
|
||||
use PhpParser\Node\Stmt\Unset_;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\NodeManipulator\AssignManipulator;
|
||||
@ -107,7 +105,10 @@ final class ReadWritePropertyAnalyzer
|
||||
}
|
||||
private function isNotInsideIssetUnset(ArrayDimFetch $arrayDimFetch) : bool
|
||||
{
|
||||
return !(bool) $this->betterNodeFinder->findParentByTypes($arrayDimFetch, [Isset_::class, Unset_::class]);
|
||||
if ($arrayDimFetch->getAttribute(AttributeKey::IS_ISSET_VAR) === \true) {
|
||||
return \false;
|
||||
}
|
||||
return $arrayDimFetch->getAttribute(AttributeKey::IS_UNSET_VAR) !== \true;
|
||||
}
|
||||
private function isArrayDimFetchRead(ArrayDimFetch $arrayDimFetch) : bool
|
||||
{
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '6f1b98ef3bf17f9b0d8df592e8605479c628b2c8';
|
||||
public const PACKAGE_VERSION = '33cfa4f7164c7b0d2c2922d4cd9f0ebdac43a5d9';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-18 20:11:18';
|
||||
public const RELEASE_DATE = '2023-06-18 20:42:41';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInitd8580d9b018097d03475b33f8ce21ff9::getLoader();
|
||||
return ComposerAutoloaderInitc256e5c59d78d03070c2c1433d8b6a30::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 ComposerAutoloaderInitd8580d9b018097d03475b33f8ce21ff9
|
||||
class ComposerAutoloaderInitc256e5c59d78d03070c2c1433d8b6a30
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInitd8580d9b018097d03475b33f8ce21ff9
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitd8580d9b018097d03475b33f8ce21ff9', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc256e5c59d78d03070c2c1433d8b6a30', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitd8580d9b018097d03475b33f8ce21ff9', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc256e5c59d78d03070c2c1433d8b6a30', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc256e5c59d78d03070c2c1433d8b6a30::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitc256e5c59d78d03070c2c1433d8b6a30::$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 ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9
|
||||
class ComposerStaticInitc256e5c59d78d03070c2c1433d8b6a30
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3095,9 +3095,9 @@ class ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitd8580d9b018097d03475b33f8ce21ff9::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc256e5c59d78d03070c2c1433d8b6a30::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc256e5c59d78d03070c2c1433d8b6a30::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc256e5c59d78d03070c2c1433d8b6a30::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user