diff --git a/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php b/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php index 95a486e87222..9e7c345e6926 100644 --- a/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php +++ b/rules/CodingStyle/Rector/Switch_/BinarySwitchToIfElseRector.php @@ -70,7 +70,7 @@ public function getNodeTypes() : array */ 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 9f0dabc8423b..a82907fc9a88 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 de7dbcaaf41f..3efbadfcb9cd 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 @@ public function isLocalPropertyFetchByName(Expr $expr, $class, string $propertyN 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 0ef56b32ac49..a66dc3349891 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ 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 d13f06b41ae2..71a9c04bfef8 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 @@ public static function getLoader() 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 2531415c58e9..d0beddd0f1c1 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); }