Updated Rector to commit 818503e3467c86f5c39ace76a94c199f7d2f6595

818503e346 Fix wrong results in RemoveAlwaysElseRector (#4527)
This commit is contained in:
Tomas Votruba 2023-07-16 06:15:25 +00:00
parent 1ff5e14615
commit 5cb3704127
5 changed files with 22 additions and 14 deletions

View File

@ -106,13 +106,21 @@ CODE_SAMPLE
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
{
$lastStmt = \end($node->stmts);
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_);
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '3b5db0a316f6c56cab67da53c9cf0de669dca652';
public const PACKAGE_VERSION = '818503e3467c86f5c39ace76a94c199f7d2f6595';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-07-16 12:48:35';
public const RELEASE_DATE = '2023-07-16 13:11:26';
/**
* @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 ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515::getLoader();
return ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515
class ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515
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__));
spl_autoload_unregister(array('ComposerAutoloaderInitc1b3f6ce7628f16157a78c09789f0515', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitea6f08e71a63d1ca58c381eec1260328', 'loadClassLoader'));
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->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$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 ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515
class ComposerStaticInitea6f08e71a63d1ca58c381eec1260328
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3028,9 +3028,9 @@ class ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc1b3f6ce7628f16157a78c09789f0515::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitea6f08e71a63d1ca58c381eec1260328::$classMap;
}, null, ClassLoader::class);
}