Updated Rector to commit b98de3edc21312c2e5483b6a120ccb04642f5346

b98de3edc2 [Php70] Handle crash on IfToSpaceshipRector with enum case (#3317)
This commit is contained in:
Tomas Votruba 2023-01-29 09:53:53 +00:00
parent 0e1b533718
commit 6d10127c95
6 changed files with 22 additions and 13 deletions

View File

@ -175,7 +175,12 @@ CODE_SAMPLE
if ($onlyIfStmt->expr === null) {
return;
}
$this->onEqual = $this->valueResolver->getValue($onlyIfStmt->expr);
// on Enum usage not in same file, it got object
$value = $this->valueResolver->getValue($onlyIfStmt->expr);
if (\is_object($value)) {
return;
}
$this->onEqual = $value;
}
}
private function processElse(Else_ $else) : void

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'd2080c2267a7bfa4b132fa3f728fd509fb3a39e3';
public const PACKAGE_VERSION = 'b98de3edc21312c2e5483b6a120ccb04642f5346';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-01-29 06:10:32';
public const RELEASE_DATE = '2023-01-29 09:48:08';
/**
* @var int
*/

View File

@ -275,6 +275,10 @@ final class ValueResolver
// fallback to constant reference itself, to avoid fatal error
return $classConstantReference;
}
if ($classReflection->isEnum()) {
// fallback to constant reference itself, to avoid fatal error
return $classConstantReference;
}
$constantReflection = $classReflection->getConstant($constant);
$valueExpr = $constantReflection->getValueExpr();
if ($valueExpr instanceof ConstFetch) {

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitd3556c4a26c03f3d75f9fb6706b88c05::getLoader();
return ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitd3556c4a26c03f3d75f9fb6706b88c05
class ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitd3556c4a26c03f3d75f9fb6706b88c05
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitd3556c4a26c03f3d75f9fb6706b88c05', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitd3556c4a26c03f3d75f9fb6706b88c05', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$files;
$requireFile = static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05
class ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3080,9 +3080,9 @@ class ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd3556c4a26c03f3d75f9fb6706b88c05::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$classMap;
}, null, ClassLoader::class);
}