mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-07 09:02:33 +02:00
Updated Rector to commit d630cc6f7961d53af1dd8fb09f7bfb93ab5591e6
d630cc6f79
Revert "[Performance] Reduce callable traverser on ContextNodeVisitor (#4357)" (#4358)
This commit is contained in:
parent
48bcc2bf0a
commit
688d913bbc
@ -8,19 +8,22 @@ use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Attribute;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Expr\Closure;
|
||||
use PhpParser\Node\Expr\Isset_;
|
||||
use PhpParser\Node\Param;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Break_;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\Do_;
|
||||
use PhpParser\Node\Stmt\Else_;
|
||||
use PhpParser\Node\Stmt\ElseIf_;
|
||||
use PhpParser\Node\Stmt\For_;
|
||||
use PhpParser\Node\Stmt\Foreach_;
|
||||
use PhpParser\Node\Stmt\Function_;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PhpParser\Node\Stmt\Unset_;
|
||||
use PhpParser\Node\Stmt\While_;
|
||||
use PhpParser\NodeTraverser;
|
||||
use PhpParser\NodeVisitorAbstract;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\PHPStan\Scope\Contract\NodeVisitor\ScopeResolverNodeVisitorInterface;
|
||||
@ -103,26 +106,18 @@ final class ContextNodeVisitor extends NodeVisitorAbstract implements ScopeResol
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param Stmt[] $node
|
||||
* @param \PhpParser\Node\Stmt\For_|\PhpParser\Node\Stmt\Foreach_|\PhpParser\Node\Stmt\While_|\PhpParser\Node\Stmt\Do_ $node
|
||||
*/
|
||||
private function processContextInLoop($node) : void
|
||||
{
|
||||
$stmts = $node instanceof Stmt ? $node->stmts : $node;
|
||||
foreach ($stmts as $stmt) {
|
||||
if ($stmt instanceof Break_) {
|
||||
$stmt->setAttribute(AttributeKey::IS_IN_LOOP, \true);
|
||||
continue;
|
||||
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($node->stmts, static function (Node $subNode) : ?int {
|
||||
if ($subNode instanceof Class_ || $subNode instanceof Function_ || $subNode instanceof Closure) {
|
||||
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
|
||||
}
|
||||
if ($stmt instanceof If_) {
|
||||
$stmt->setAttribute(AttributeKey::IS_IN_LOOP, \true);
|
||||
$this->processContextInLoop($stmt->stmts);
|
||||
foreach ($stmt->elseifs as $elseif) {
|
||||
$this->processContextInLoop($elseif->stmts);
|
||||
}
|
||||
if ($stmt->else instanceof Else_) {
|
||||
$this->processContextInLoop($stmt->else->stmts);
|
||||
}
|
||||
if ($subNode instanceof If_ || $subNode instanceof Break_) {
|
||||
$subNode->setAttribute(AttributeKey::IS_IN_LOOP, \true);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '634d71557a10f7b0f79ccfaaca2ebaef995b97dc';
|
||||
public const PACKAGE_VERSION = 'd630cc6f7961d53af1dd8fb09f7bfb93ab5591e6';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-27 12:45:07';
|
||||
public const RELEASE_DATE = '2023-06-27 06:01:50';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInitd9e3e44fe6afb441609b8b90e09d33a0::getLoader();
|
||||
return ComposerAutoloaderInitba7b2cd40952c7decad7e28ce970948a::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 ComposerAutoloaderInitd9e3e44fe6afb441609b8b90e09d33a0
|
||||
class ComposerAutoloaderInitba7b2cd40952c7decad7e28ce970948a
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInitd9e3e44fe6afb441609b8b90e09d33a0
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitd9e3e44fe6afb441609b8b90e09d33a0', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitba7b2cd40952c7decad7e28ce970948a', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitd9e3e44fe6afb441609b8b90e09d33a0', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitba7b2cd40952c7decad7e28ce970948a', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitba7b2cd40952c7decad7e28ce970948a::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitba7b2cd40952c7decad7e28ce970948a::$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 ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0
|
||||
class ComposerStaticInitba7b2cd40952c7decad7e28ce970948a
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3098,9 +3098,9 @@ class ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitd9e3e44fe6afb441609b8b90e09d33a0::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitba7b2cd40952c7decad7e28ce970948a::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitba7b2cd40952c7decad7e28ce970948a::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitba7b2cd40952c7decad7e28ce970948a::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user