From 38c5a7e717277d2ece93a68cd6b55ec16d1be66e Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 1 May 2023 13:29:39 +0000 Subject: [PATCH] Updated Rector to commit 3c7f2e8275e480d6555f8dd37316ea694d700774 https://github.com/rectorphp/rector-src/commit/3c7f2e8275e480d6555f8dd37316ea694d700774 [NodeManipulator] Improve IfManipulator::collectNestedIfsWithNonBreaking() performance (#3720) --- src/Application/VersionResolver.php | 4 ++-- src/NodeManipulator/IfManipulator.php | 9 ++++----- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 73bd9f4d48fc..0cea1ca975b2 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '0204a2353850c98a38dba36c9a8dd031ae2da0c3'; + public const PACKAGE_VERSION = '3c7f2e8275e480d6555f8dd37316ea694d700774'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-05-01 19:10:12'; + public const RELEASE_DATE = '2023-05-01 13:25:44'; /** * @var int */ diff --git a/src/NodeManipulator/IfManipulator.php b/src/NodeManipulator/IfManipulator.php index 1d67ddad1bdd..c3f0f20d22e4 100644 --- a/src/NodeManipulator/IfManipulator.php +++ b/src/NodeManipulator/IfManipulator.php @@ -175,13 +175,12 @@ public function collectNestedIfsWithNonBreaking(Foreach_ $foreach) : array if (!$this->isIfWithoutElseAndElseIfs($currentIf)) { return []; } - $betterNodeFinderFindInstanceOf = $this->betterNodeFinder->findInstanceOf($currentIf->stmts, Return_::class); - if ($betterNodeFinderFindInstanceOf !== []) { + $return = $this->betterNodeFinder->findFirstInstanceOf($currentIf->stmts, Return_::class); + if ($return instanceof Return_) { return []; } - /** @var Exit_[] $exits */ - $exits = $this->betterNodeFinder->findInstanceOf($currentIf->stmts, Exit_::class); - if ($exits !== []) { + $exit = $this->betterNodeFinder->findFirstInstanceOf($currentIf->stmts, Exit_::class); + if ($exit instanceof Exit_) { return []; } // last node is with the expression diff --git a/vendor/autoload.php b/vendor/autoload.php index fef27c4e077b..1fbdc4373d12 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitb24069e0cf6ac04fa15ac0cf1e5399b6::getLoader(); +return ComposerAutoloaderInit2d88f54e65d8af25b0f87fde040edc1f::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 88e91271b464..67ec154d1840 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitb24069e0cf6ac04fa15ac0cf1e5399b6 +class ComposerAutoloaderInit2d88f54e65d8af25b0f87fde040edc1f { private static $loader; @@ -22,17 +22,17 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitb24069e0cf6ac04fa15ac0cf1e5399b6', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit2d88f54e65d8af25b0f87fde040edc1f', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitb24069e0cf6ac04fa15ac0cf1e5399b6', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit2d88f54e65d8af25b0f87fde040edc1f', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit2d88f54e65d8af25b0f87fde040edc1f::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit2d88f54e65d8af25b0f87fde040edc1f::$files; $requireFile = \Closure::bind(static function ($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 1eae89f73685..44db06e119ac 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6 +class ComposerStaticInit2d88f54e65d8af25b0f87fde040edc1f { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3152,9 +3152,9 @@ class ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitb24069e0cf6ac04fa15ac0cf1e5399b6::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit2d88f54e65d8af25b0f87fde040edc1f::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit2d88f54e65d8af25b0f87fde040edc1f::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit2d88f54e65d8af25b0f87fde040edc1f::$classMap; }, null, ClassLoader::class); }