Updated Rector to commit 3806bb8f05a822d081a69f735745ae2f14caf657

3806bb8f05 [NodeManipulator] Reduce parent lookup on PropertyManipulator under Unset_ (#4273)
This commit is contained in:
Tomas Votruba 2023-06-18 09:44:52 +00:00
parent b326a57561
commit ed58f0fcb1
7 changed files with 23 additions and 14 deletions

View File

@ -188,4 +188,8 @@ final class AttributeKey
* @var string
*/
public const IS_IN_LOOP = 'is_in_loop';
/**
* @var string
*/
public const IS_UNSET_VAR = 'is_unset_var';
}

View File

@ -12,6 +12,7 @@ use PhpParser\Node\Stmt\Do_;
use PhpParser\Node\Stmt\For_;
use PhpParser\Node\Stmt\Foreach_;
use PhpParser\Node\Stmt\If_;
use PhpParser\Node\Stmt\Unset_;
use PhpParser\Node\Stmt\While_;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitorAbstract;
@ -43,6 +44,11 @@ final class ContextNodeVisitor extends NodeVisitorAbstract implements ScopeResol
});
return null;
}
if ($node instanceof Unset_) {
foreach ($node->vars as $var) {
$var->setAttribute(AttributeKey::IS_UNSET_VAR, \true);
}
}
return null;
}
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '805b7b7d39fcd989873452ddbbd57e2a76150022';
public const PACKAGE_VERSION = '3806bb8f05a822d081a69f735745ae2f14caf657';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-18 13:18:11';
public const RELEASE_DATE = '2023-06-18 16:40:15';
/**
* @var int
*/

View File

@ -168,8 +168,7 @@ final class PropertyManipulator
if ($this->assignManipulator->isLeftPartOfAssign($propertyFetch)) {
return \true;
}
$isInUnset = (bool) $this->betterNodeFinder->findParentType($propertyFetch, Unset_::class);
if ($isInUnset) {
if ($propertyFetch->getAttribute(AttributeKey::IS_UNSET_VAR) === \true) {
return \true;
}
}

2
vendor/autoload.php vendored
View File

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

View File

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