From 87451f1fce3d771536a508e90eeddac25cd66038 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 29 Jul 2023 09:44:46 +0000 Subject: [PATCH] Updated Rector to commit 784894e8ed4260ae3c8d45a28e007f4b6fe98f4d https://github.com/rectorphp/rector-src/commit/784894e8ed4260ae3c8d45a28e007f4b6fe98f4d [CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector (#4618) --- .../Rector/Switch_/BinarySwitchToIfElseRector.php | 2 +- src/Application/VersionResolver.php | 4 ++-- src/PhpParser/NodeFinder/PropertyFetchFinder.php | 3 ++- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php b/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php index 95a486e8722..9e7c345e692 100644 --- a/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php +++ b/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php @@ -70,7 +70,7 @@ CODE_SAMPLE */ public function refactor(Node $node) : ?Node { - if (\count($node->cases) > 2) { + if ($node->cases === [] || \count($node->cases) > 2) { return null; } // avoid removal of cases if it goes to be skipped next diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 9f0dabc8423..a82907fc9a8 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 = '42c4c635912957da83e9b0cc5881be7bcc4c5a73'; + public const PACKAGE_VERSION = '784894e8ed4260ae3c8d45a28e007f4b6fe98f4d'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-07-28 22:24:41'; + public const RELEASE_DATE = '2023-07-29 09:40:35'; /** * @var int */ diff --git a/src/PhpParser/NodeFinder/PropertyFetchFinder.php b/src/PhpParser/NodeFinder/PropertyFetchFinder.php index de7dbcaaf41..3efbadfcb9c 100644 --- a/src/PhpParser/NodeFinder/PropertyFetchFinder.php +++ b/src/PhpParser/NodeFinder/PropertyFetchFinder.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace Rector\Core\PhpParser\NodeFinder; +use PHPStan\Type\StaticType; use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\ArrayDimFetch; @@ -152,7 +153,7 @@ final class PropertyFetchFinder return \true; } $type = $this->nodeTypeResolver->getType($expr->var); - if ($type instanceof \PHPStan\Type\StaticType || $type instanceof FullyQualifiedObjectType) { + if ($type instanceof StaticType || $type instanceof FullyQualifiedObjectType) { return $this->nodeNameResolver->isName($class, $type->getClassName()); } return \false; diff --git a/vendor/autoload.php b/vendor/autoload.php index 0ef56b32ac4..a66dc334989 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4::getLoader(); +return ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index d13f06b41ae..71a9c04bfef 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4 +class ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2::$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 2531415c58e..d0beddd0f1c 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4 +class ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3023,9 +3023,9 @@ class ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2::$classMap; }, null, ClassLoader::class); }