Skip to content

Commit

Permalink
Updated Rector to commit 3806bb8f05a822d081a69f735745ae2f14caf657
Browse files Browse the repository at this point in the history
rectorphp/rector-src@3806bb8 [NodeManipulator] Reduce parent lookup on PropertyManipulator under Unset_ (#4273)
  • Loading branch information
TomasVotruba committed Jun 18, 2023
1 parent b326a57 commit ed58f0f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
4 changes: 4 additions & 0 deletions packages/NodeTypeResolver/Node/AttributeKey.php
Expand Up @@ -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';
}
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -43,6 +44,11 @@ public function enterNode(Node $node) : ?Node
});
return null;
}
if ($node instanceof Unset_) {
foreach ($node->vars as $var) {
$var->setAttribute(AttributeKey::IS_UNSET_VAR, \true);
}
}
return null;
}
}
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Expand Up @@ -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
*/
Expand Down
3 changes: 1 addition & 2 deletions src/NodeManipulator/PropertyManipulator.php
Expand Up @@ -168,8 +168,7 @@ public function isPropertyChangeableExceptConstructor(Class_ $class, $propertyOr
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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit470ad92e04ebe7807935539568e0c68f::getLoader();
return ComposerAutoloaderInitcf1d947e9768c34d09a4e46d10546389::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit470ad92e04ebe7807935539568e0c68f
class ComposerAutoloaderInitcf1d947e9768c34d09a4e46d10546389
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
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;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit470ad92e04ebe7807935539568e0c68f
class ComposerStaticInitcf1d947e9768c34d09a4e46d10546389
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ed58f0f

Please sign in to comment.