diff --git a/rules/EarlyReturn/Rector/If_/ChangeNestedIfsToEarlyReturnRector.php b/rules/EarlyReturn/Rector/If_/ChangeNestedIfsToEarlyReturnRector.php index 2e44ba59e3c..79efde47ead 100644 --- a/rules/EarlyReturn/Rector/If_/ChangeNestedIfsToEarlyReturnRector.php +++ b/rules/EarlyReturn/Rector/If_/ChangeNestedIfsToEarlyReturnRector.php @@ -87,9 +87,14 @@ CODE_SAMPLE if ($stmts === null) { return null; } + /** @var Stmt[] $previousStmts[] */ + $previousStmts = []; foreach ($stmts as $key => $stmt) { $nextStmt = $stmts[$key + 1] ?? null; if (!$nextStmt instanceof Return_) { + if ($nextStmt instanceof Stmt) { + $previousStmts[] = $stmt; + } continue; } if (!$stmt instanceof If_) { @@ -99,7 +104,7 @@ CODE_SAMPLE if ($nestedIfsWithOnlyReturn === []) { continue; } - $node->stmts = $this->processNestedIfsWithOnlyReturn($nestedIfsWithOnlyReturn, $nextStmt); + $node->stmts = \array_merge($previousStmts, $this->processNestedIfsWithOnlyReturn($nestedIfsWithOnlyReturn, $nextStmt)); return $node; } return null; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index ab2e6a76137..7c954d8bc0b 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -17,12 +17,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'cb7a84c8bb0343205b7c9ce5d6442187dd089b28'; + public const PACKAGE_VERSION = '837c2262f13e5b8faffdb02c5d9fb701d581fa61'; /** * @api * @var string */ - public const RELEASE_DATE = '2022-08-23 18:11:13'; + public const RELEASE_DATE = '2022-08-23 18:13:34'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index c8528f0e8af..47913ea61f6 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit04728a237bd85a947e72064c342f9603::getLoader(); +return ComposerAutoloaderInit056fb7a41d9848c9734584959af9dabf::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 928d2c80936..f0586612184 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit04728a237bd85a947e72064c342f9603 +class ComposerAutoloaderInit056fb7a41d9848c9734584959af9dabf { private static $loader; @@ -22,19 +22,19 @@ class ComposerAutoloaderInit04728a237bd85a947e72064c342f9603 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit04728a237bd85a947e72064c342f9603', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit056fb7a41d9848c9734584959af9dabf', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit04728a237bd85a947e72064c342f9603', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit056fb7a41d9848c9734584959af9dabf', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit04728a237bd85a947e72064c342f9603::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit056fb7a41d9848c9734584959af9dabf::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit04728a237bd85a947e72064c342f9603::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInit056fb7a41d9848c9734584959af9dabf::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire04728a237bd85a947e72064c342f9603($fileIdentifier, $file); + composerRequire056fb7a41d9848c9734584959af9dabf($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ class ComposerAutoloaderInit04728a237bd85a947e72064c342f9603 * @param string $file * @return void */ -function composerRequire04728a237bd85a947e72064c342f9603($fileIdentifier, $file) +function composerRequire056fb7a41d9848c9734584959af9dabf($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 380e31a90cf..c30f902358b 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit04728a237bd85a947e72064c342f9603 +class ComposerStaticInit056fb7a41d9848c9734584959af9dabf { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', @@ -3256,9 +3256,9 @@ class ComposerStaticInit04728a237bd85a947e72064c342f9603 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit04728a237bd85a947e72064c342f9603::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit04728a237bd85a947e72064c342f9603::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit04728a237bd85a947e72064c342f9603::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit056fb7a41d9848c9734584959af9dabf::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit056fb7a41d9848c9734584959af9dabf::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit056fb7a41d9848c9734584959af9dabf::$classMap; }, null, ClassLoader::class); }