Updated Rector to commit a4ef13b30cfd2ee5a02f547256673064d648c558

a4ef13b30c [NodeAnalyzer] Check statementDepth on Stmt, and expressionDepth on Expr on ScopeAnalyzer (#4425)
This commit is contained in:
Tomas Votruba 2023-07-05 17:31:36 +00:00
parent 4ded5a660a
commit 92a790ae25
5 changed files with 18 additions and 14 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '9df1445de8c8cb5eed5a85446628226f9b03ed76';
public const PACKAGE_VERSION = 'a4ef13b30cfd2ee5a02f547256673064d648c558';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-07-05 16:27:26';
public const RELEASE_DATE = '2023-07-06 00:27:20';
/**
* @var int
*/

View File

@ -5,9 +5,11 @@ namespace Rector\Core\NodeAnalyzer;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt;
use PHPStan\Analyser\MutatingScope;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\PHPStan\Scope\ScopeFactory;
@ -40,10 +42,12 @@ final class ScopeAnalyzer
if ($mutatingScope instanceof MutatingScope) {
return $mutatingScope;
}
if ($node->getAttribute(AttributeKey::STATEMENT_DEPTH) === 0) {
// on File level
if ($node instanceof Stmt && $node->getAttribute(AttributeKey::STATEMENT_DEPTH) === 0) {
return $this->scopeFactory->createFromFile($filePath);
}
if ($node->getAttribute(AttributeKey::EXPRESSION_DEPTH) >= 2) {
// too deep Expr, eg: $$param = $$bar = self::decodeValue($result->getItem()->getTextContent());
if ($node instanceof Expr && $node->getAttribute(AttributeKey::EXPRESSION_DEPTH) >= 2) {
return $this->scopeFactory->createFromFile($filePath);
}
/**

2
vendor/autoload.php vendored
View File

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

View File

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