mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 05:03:31 +00:00
Updated Rector to commit 818503e3467c86f5c39ace76a94c199f7d2f6595
818503e346
Fix wrong results in RemoveAlwaysElseRector (#4527)
This commit is contained in:
parent
1ff5e14615
commit
5cb3704127
|
@ -106,13 +106,21 @@ CODE_SAMPLE
|
||||||
return $statements;
|
return $statements;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param \PhpParser\Node\Stmt\If_|\PhpParser\Node\Stmt\ElseIf_ $node
|
* @param \PhpParser\Node\Stmt\If_|\PhpParser\Node\Stmt\ElseIf_|\PhpParser\Node\Stmt\Else_ $node
|
||||||
*/
|
*/
|
||||||
private function doesLastStatementBreakFlow($node) : bool
|
private function doesLastStatementBreakFlow($node) : bool
|
||||||
{
|
{
|
||||||
$lastStmt = \end($node->stmts);
|
$lastStmt = \end($node->stmts);
|
||||||
if ($lastStmt instanceof If_ && $lastStmt->else instanceof Else_) {
|
if ($lastStmt instanceof If_ && $lastStmt->else instanceof Else_) {
|
||||||
return $this->doesLastStatementBreakFlow($lastStmt);
|
if ($this->doesLastStatementBreakFlow($lastStmt) || $this->doesLastStatementBreakFlow($lastStmt->else)) {
|
||||||
|
return \true;
|
||||||
|
}
|
||||||
|
foreach ($lastStmt->elseifs as $elseIf) {
|
||||||
|
if ($this->doesLastStatementBreakFlow($elseIf)) {
|
||||||
|
return \true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return \false;
|
||||||
}
|
}
|
||||||
return !($lastStmt instanceof Return_ || $lastStmt instanceof Throw_ || $lastStmt instanceof Continue_ || $lastStmt instanceof Expression && $lastStmt->expr instanceof Exit_);
|
return !($lastStmt instanceof Return_ || $lastStmt instanceof Throw_ || $lastStmt instanceof Continue_ || $lastStmt instanceof Expression && $lastStmt->expr instanceof Exit_);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '3b5db0a316f6c56cab67da53c9cf0de669dca652';
|
public const PACKAGE_VERSION = '818503e3467c86f5c39ace76a94c199f7d2f6595';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2023-07-16 12:48:35';
|
public const RELEASE_DATE = '2023-07-16 13:11:26';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @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';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515::getLoader();
|
return ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328::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
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515
|
class ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515
|
||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328', 'loadClassLoader'));
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
require __DIR__ . '/autoload_static.php';
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::getInitializer($loader));
|
||||||
|
|
||||||
$loader->setClassMapAuthoritative(true);
|
$loader->setClassMapAuthoritative(true);
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$files;
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$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;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515
|
class ComposerStaticInitea6f08e71a63d1ca58c381eec1260328
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||||
|
@ -3028,9 +3028,9 @@ class ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515
|
||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$classMap;
|
$loader->classMap = ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user