mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-18 22:39:44 +01:00
Updated Rector to commit 784894e8ed4260ae3c8d45a28e007f4b6fe98f4d
784894e8ed
[CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector (#4618)
This commit is contained in:
parent
13c57eb649
commit
87451f1fce
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4::getLoader();
|
||||
return ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -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;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user