Updated Rector to commit 2449c45be390824bb4230e17c776f68e1f66e89c

2449c45be3 [Core] Remove manual reindex stmt_key on ChangedNodeScopeRefresher::reIndexNodeAttributes() (#4109)
This commit is contained in:
Tomas Votruba 2023-06-07 15:52:33 +00:00
parent 87fdd5999d
commit fd9beab0d3
6 changed files with 13 additions and 30 deletions

View File

@ -43,6 +43,7 @@ final class StmtKeyNodeVisitor extends NodeVisitorAbstract implements ScopeResol
if ($node->stmts === null) {
return null;
}
$node->stmts = \array_values($node->stmts);
// re-index stmt key under current node
foreach ($node->stmts as $key => $childStmt) {
$childStmt->setAttribute(AttributeKey::STMT_KEY, $key);

View File

@ -16,9 +16,7 @@ use PhpParser\Node\Expr\NullsafeMethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Declare_;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\If_;
@ -26,7 +24,6 @@ use PhpParser\Node\Stmt\Property;
use PhpParser\Node\Stmt\Switch_;
use PhpParser\Node\Stmt\TryCatch;
use PHPStan\Analyser\MutatingScope;
use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\NodeAnalyzer\ScopeAnalyzer;
use Rector\Core\Provider\CurrentFileProvider;
@ -97,17 +94,6 @@ final class ChangedNodeScopeRefresher
}
public function reIndexNodeAttributes(Node $node) : void
{
if ($this->hasArrayStmtsNode($node)) {
/**
* @var StmtsAwareInterface|ClassLike|Declare_ $node
* @var Stmt[] $stmts
*/
$stmts = $node->stmts;
$node->stmts = \array_values($stmts);
foreach ($node->stmts as $key => $stmt) {
$stmt->setAttribute(AttributeKey::STMT_KEY, $key);
}
}
if ($node instanceof FunctionLike) {
/** @var ClassMethod|Function_|Closure $node */
$node->params = \array_values($node->params);
@ -129,10 +115,6 @@ final class ChangedNodeScopeRefresher
$node->cases = \array_values($node->cases);
}
}
private function hasArrayStmtsNode(Node $node) : bool
{
return ($node instanceof ClassLike || $node instanceof StmtsAwareInterface || $node instanceof Declare_) && $node->stmts !== null;
}
/**
* @return Stmt[]
*/

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '63816c03ac4b36a7fdaa28b5944a8fca9f9ed6b8';
public const PACKAGE_VERSION = '2449c45be390824bb4230e17c776f68e1f66e89c';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-07 21:43:57';
public const RELEASE_DATE = '2023-06-07 22:48:48';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

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