mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
Updated Rector to commit 582af523662c9aac2603a1535d58fc932ab1c330
582af52366
Refactor PARENT_NODE from ChangeAndIfToEarlyReturnRector (#3985)
This commit is contained in:
parent
4af8e96d37
commit
466c54de06
@ -24,7 +24,6 @@ use Rector\EarlyReturn\NodeAnalyzer\SimpleScalarAnalyzer;
|
||||
use Rector\EarlyReturn\NodeFactory\InvertedIfFactory;
|
||||
use Rector\NodeCollector\BinaryOpConditionsCollector;
|
||||
use Rector\NodeNestingScope\ContextAnalyzer;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
@ -214,20 +213,13 @@ CODE_SAMPLE
|
||||
if ($this->ifAndAnalyzer->isIfAndWithInstanceof($if->cond)) {
|
||||
return \true;
|
||||
}
|
||||
return !$this->isLastIfOrBeforeLastReturn($if, $nexStmt);
|
||||
return !$this->isLastIfOrBeforeLastReturn($nexStmt);
|
||||
}
|
||||
private function isLastIfOrBeforeLastReturn(If_ $if, ?Stmt $nextStmt) : bool
|
||||
private function isLastIfOrBeforeLastReturn(?Stmt $nextStmt) : bool
|
||||
{
|
||||
if ($nextStmt instanceof Node) {
|
||||
return $nextStmt instanceof Return_;
|
||||
if (!$nextStmt instanceof Stmt) {
|
||||
return \true;
|
||||
}
|
||||
$parentNode = $if->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if (!$parentNode instanceof Node) {
|
||||
return \false;
|
||||
}
|
||||
if ($parentNode instanceof If_) {
|
||||
return $this->isLastIfOrBeforeLastReturn($parentNode, $nextStmt);
|
||||
}
|
||||
return \true;
|
||||
return $nextStmt instanceof Return_;
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '330e1c5845ca7a569840384fa6eb3e730e13df71';
|
||||
public const PACKAGE_VERSION = '582af523662c9aac2603a1535d58fc932ab1c330';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-05-27 09:27:00';
|
||||
public const RELEASE_DATE = '2023-05-27 10:49:03';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInita7945aa362870c861fc11770421a1521::getLoader();
|
||||
return ComposerAutoloaderInite2205975d34f6a61a31c784eba830e2f::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 ComposerAutoloaderInita7945aa362870c861fc11770421a1521
|
||||
class ComposerAutoloaderInite2205975d34f6a61a31c784eba830e2f
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInita7945aa362870c861fc11770421a1521
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita7945aa362870c861fc11770421a1521', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInite2205975d34f6a61a31c784eba830e2f', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita7945aa362870c861fc11770421a1521', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite2205975d34f6a61a31c784eba830e2f', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita7945aa362870c861fc11770421a1521::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite2205975d34f6a61a31c784eba830e2f::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInita7945aa362870c861fc11770421a1521::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInite2205975d34f6a61a31c784eba830e2f::$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 ComposerStaticInita7945aa362870c861fc11770421a1521
|
||||
class ComposerStaticInite2205975d34f6a61a31c784eba830e2f
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3046,9 +3046,9 @@ class ComposerStaticInita7945aa362870c861fc11770421a1521
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita7945aa362870c861fc11770421a1521::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita7945aa362870c861fc11770421a1521::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita7945aa362870c861fc11770421a1521::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite2205975d34f6a61a31c784eba830e2f::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite2205975d34f6a61a31c784eba830e2f::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInite2205975d34f6a61a31c784eba830e2f::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user