Updated Rector to commit 24f8610224663ef71ca2e4007ef89997303f53b9

24f8610224 [NodeTypeResolver] Remove next node on PHPStanNodeScopeResolver (#3888)
This commit is contained in:
Tomas Votruba 2023-05-18 18:55:12 +00:00
parent ab605a51c8
commit 11f05b657f
5 changed files with 25 additions and 17 deletions

View File

@ -43,6 +43,7 @@ use PHPStan\Type\ObjectType;
use PHPStan\Type\TypeCombinator;
use Rector\Caching\Detector\ChangedFilesDetector;
use Rector\Caching\FileSystem\DependencyResolver;
use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\NodeAnalyzer\ClassAnalyzer;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
@ -290,11 +291,18 @@ final class PHPStanNodeScopeResolver
$originalStmt->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
$originalStmt->setAttribute(AttributeKey::SCOPE, $mutatingScope);
$this->processNodes([$originalStmt], $filePath, $mutatingScope);
$nextNode = $originalStmt->getAttribute(AttributeKey::NEXT_NODE);
while ($nextNode instanceof Stmt) {
$nextNode->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
$this->processNodes([$nextNode], $filePath, $mutatingScope);
$nextNode = $nextNode->getAttribute(AttributeKey::NEXT_NODE);
$parentNode = $unreachableStatementNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof StmtsAwareInterface) {
return;
}
$stmtKey = $unreachableStatementNode->getAttribute(AttributeKey::STMT_KEY);
$totalKeys = $parentNode->stmts === null ? 0 : \count($parentNode->stmts);
for ($key = $stmtKey + 1; $key < $totalKeys; ++$key) {
if (!isset($parentNode->stmts[$key])) {
continue;
}
$parentNode->stmts[$key]->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
$this->processNodes([$parentNode->stmts[$key]], $filePath, $mutatingScope);
}
}
private function processProperty(Property $property, MutatingScope $mutatingScope) : void

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '1c2865afd4556f1dc27b94e5d18145680c8e7497';
public const PACKAGE_VERSION = '24f8610224663ef71ca2e4007ef89997303f53b9';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-05-18 22:33:01';
public const RELEASE_DATE = '2023-05-19 01:51:10';
/**
* @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 ComposerAutoloaderInit01208f4de7da9413a352a38b230ea588::getLoader();
return ComposerAutoloaderInitc811d8c459688b50539fb06d40047f43::getLoader();

View File

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