Updated Rector to commit 64d0a8375814c9da2fe93036e4c0fa5fbf06aa25

64d0a83758 [Php80][CodeQuality] Handle crash on ExplicitMethodCallOverMagicGetSetRector+ChangeSwitchToMatchRector (#3034)
This commit is contained in:
Tomas Votruba 2022-11-05 11:30:02 +00:00
parent f9414241aa
commit 0d82d6bf1d
8 changed files with 38 additions and 32 deletions

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit1c82123137ac3e72e5dd596dc5b3a155
class ComposerAutoloaderInit6d219da7059a0e2328609f8a39103f93
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit1c82123137ac3e72e5dd596dc5b3a155
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit1c82123137ac3e72e5dd596dc5b3a155', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit6d219da7059a0e2328609f8a39103f93', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit1c82123137ac3e72e5dd596dc5b3a155', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit6d219da7059a0e2328609f8a39103f93', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit6d219da7059a0e2328609f8a39103f93::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit6d219da7059a0e2328609f8a39103f93::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire1c82123137ac3e72e5dd596dc5b3a155($fileIdentifier, $file);
composerRequire6d219da7059a0e2328609f8a39103f93($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit1c82123137ac3e72e5dd596dc5b3a155
* @param string $file
* @return void
*/
function composerRequire1c82123137ac3e72e5dd596dc5b3a155($fileIdentifier, $file)
function composerRequire6d219da7059a0e2328609f8a39103f93($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 ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155
class ComposerStaticInit6d219da7059a0e2328609f8a39103f93
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3053,9 +3053,9 @@ class ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit1c82123137ac3e72e5dd596dc5b3a155::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit6d219da7059a0e2328609f8a39103f93::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6d219da7059a0e2328609f8a39103f93::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6d219da7059a0e2328609f8a39103f93::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2059,12 +2059,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
"reference": "d9de658bacc7678b21b6260e228f5643ef6a17ed"
"reference": "0a98dbb101f332ea4a395ab5aa82221935fc3573"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/d9de658bacc7678b21b6260e228f5643ef6a17ed",
"reference": "d9de658bacc7678b21b6260e228f5643ef6a17ed",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/0a98dbb101f332ea4a395ab5aa82221935fc3573",
"reference": "0a98dbb101f332ea4a395ab5aa82221935fc3573",
"shasum": ""
},
"require": {
@ -2090,7 +2090,7 @@
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-11-01T14:00:24+00:00",
"time": "2022-11-05T11:15:45+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2128,12 +2128,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "56b183d5f49b526369c5ac35d5bdbec6ef2f16e2"
"reference": "fd2b5dc1e2840ccd8edd8dab265053fb9f4ceba9"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/56b183d5f49b526369c5ac35d5bdbec6ef2f16e2",
"reference": "56b183d5f49b526369c5ac35d5bdbec6ef2f16e2",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/fd2b5dc1e2840ccd8edd8dab265053fb9f4ceba9",
"reference": "fd2b5dc1e2840ccd8edd8dab265053fb9f4ceba9",
"shasum": ""
},
"require": {
@ -2164,7 +2164,7 @@
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-11-02T10:53:32+00:00",
"time": "2022-11-05T11:14:53+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 17bdb82'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main da1013f'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9c21f5f'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 294de0c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d9de658'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 56b183d'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 17bdb82'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main da1013f'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9c21f5f'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 294de0c'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0a98dbb'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main fd2b5dc'));
private function __construct()
{
}

View File

@ -93,16 +93,25 @@ final class AssertEqualsToSameRector extends AbstractRector
if (!$type instanceof ConstantArrayType) {
return \false;
}
return $this->hasNonScalarType($type);
}
private function hasNonScalarType(ConstantArrayType $constantArrayType) : bool
{
$valueTypes = $constantArrayType->getValueTypes();
// empty array
if ($type->getValueTypes() === []) {
if ($valueTypes === []) {
return \false;
}
/**
* Non empty array, but value cannot be retrieved via ValueResolver, then there is possibly an dynamic value
* inside
*/
$value = $this->valueResolver->getValue($expr);
return $value === [];
foreach ($valueTypes as $valueType) {
if ($valueType instanceof ConstantArrayType && $this->hasNonScalarType($valueType)) {
return \true;
}
// non-scalar type can be an object or mixed, which should be skipped
if (!$this->isScalarType($valueType)) {
return \true;
}
}
return \false;
}
private function isScalarType(Type $valueNodeType) : bool
{

View File

@ -129,9 +129,6 @@ CODE_SAMPLE
return null;
}
$statusCode = $this->valueResolver->getValue($args[0]->value, \true);
if ($statusCode === null) {
return null;
}
// handled by another method
if ($statusCode === 200) {
return null;