mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Updated Rector to commit 654d4a2a2ba408a3143a5a11a775750b90b27866
654d4a2a2b
[EarlyReturn] Skip ChangeOrIfReturnToEarlyReturnRector on next node is null or return void (#796)
This commit is contained in:
parent
798dab0ffa
commit
13cd556d23
@ -11,6 +11,7 @@ use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use Rector\Core\NodeManipulator\IfManipulator;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
@ -80,6 +81,13 @@ CODE_SAMPLE
|
||||
if ($this->isInstanceofCondOnly($node->cond)) {
|
||||
return null;
|
||||
}
|
||||
$nextNode = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
if ($nextNode === null) {
|
||||
return null;
|
||||
}
|
||||
if ($nextNode instanceof \PhpParser\Node\Stmt\Return_ && $nextNode->expr === null) {
|
||||
return null;
|
||||
}
|
||||
/** @var Return_ $return */
|
||||
$return = $node->stmts[0];
|
||||
$ifs = $this->createMultipleIfs($node->cond, $return, []);
|
||||
|
@ -16,11 +16,11 @@ final class VersionResolver
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '9247ba932a695da7fff0d86d7431197cccda974b';
|
||||
public const PACKAGE_VERSION = '654d4a2a2ba408a3143a5a11a775750b90b27866';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-08-31 13:32:42';
|
||||
public const RELEASE_DATE = '2021-08-31 19:20:06';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210831\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83::getLoader();
|
||||
return ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83
|
||||
class ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit7dc5125f070db1d4791ec92ffe204c39::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
@ -42,19 +42,19 @@ class ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit7dc5125f070db1d4791ec92ffe204c39::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirecfaa75631109e8039e47a3ab75c7dc83($fileIdentifier, $file);
|
||||
composerRequire7dc5125f070db1d4791ec92ffe204c39($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirecfaa75631109e8039e47a3ab75c7dc83($fileIdentifier, $file)
|
||||
function composerRequire7dc5125f070db1d4791ec92ffe204c39($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83
|
||||
class ComposerStaticInit7dc5125f070db1d4791ec92ffe204c39
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
@ -3856,9 +3856,9 @@ class ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitcfaa75631109e8039e47a3ab75c7dc83::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7dc5125f070db1d4791ec92ffe204c39::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit7dc5125f070db1d4791ec92ffe204c39::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit7dc5125f070db1d4791ec92ffe204c39::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
|
||||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20210831\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83', false) && !interface_exists('ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83', false) && !trait_exists('ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83', false)) {
|
||||
spl_autoload_call('RectorPrefix20210831\ComposerAutoloaderInitcfaa75631109e8039e47a3ab75c7dc83');
|
||||
if (!class_exists('ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39', false) && !interface_exists('ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39', false) && !trait_exists('ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39', false)) {
|
||||
spl_autoload_call('RectorPrefix20210831\ComposerAutoloaderInit7dc5125f070db1d4791ec92ffe204c39');
|
||||
}
|
||||
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
|
||||
spl_autoload_call('RectorPrefix20210831\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
@ -3311,9 +3311,9 @@ if (!function_exists('print_node')) {
|
||||
return \RectorPrefix20210831\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequirecfaa75631109e8039e47a3ab75c7dc83')) {
|
||||
function composerRequirecfaa75631109e8039e47a3ab75c7dc83() {
|
||||
return \RectorPrefix20210831\composerRequirecfaa75631109e8039e47a3ab75c7dc83(...func_get_args());
|
||||
if (!function_exists('composerRequire7dc5125f070db1d4791ec92ffe204c39')) {
|
||||
function composerRequire7dc5125f070db1d4791ec92ffe204c39() {
|
||||
return \RectorPrefix20210831\composerRequire7dc5125f070db1d4791ec92ffe204c39(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user