Skip to content

Commit

Permalink
Updated Rector to commit 784894e8ed4260ae3c8d45a28e007f4b6fe98f4d
Browse files Browse the repository at this point in the history
rectorphp/rector-src@784894e [CodingStyle] Handle crash on empty cases on BinarySwitchToIfElseRector (#4618)
  • Loading branch information
TomasVotruba committed Jul 29, 2023
1 parent 13c57eb commit 87451f1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion src/PhpParser/NodeFinder/PropertyFetchFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4::getLoader();
return ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit6b72a3b7a42ee6a1a7355258610b3fc4
class ComposerAutoloaderInita5c78145b82446a0ff8c919e6a17a6f2
{
private static $loader;

Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit6b72a3b7a42ee6a1a7355258610b3fc4
class ComposerStaticInita5c78145b82446a0ff8c919e6a17a6f2
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 87451f1

Please sign in to comment.