Updated Rector to commit f4ff24c16110daa22312f443fd25e88060e17123

f4ff24c161 Skip short class names in UseClassKeywordForClassNameResolutionRector (#3156)
This commit is contained in:
Tomas Votruba 2022-12-05 11:03:13 +00:00
parent fbfbe499d0
commit 62c3ac9363
10 changed files with 42 additions and 30 deletions

View File

@ -59,8 +59,9 @@ CODE_SAMPLE
return null;
}
$classNames = $this->getExistingClasses($node);
$classNames = $this->filterOurShortClasses($classNames);
if ($classNames === []) {
return $node;
return null;
}
$parts = $this->getParts($node, $classNames);
if ($parts === []) {
@ -117,4 +118,14 @@ CODE_SAMPLE
}
return $exprsToConcat;
}
/**
* @param string[] $classNames
* @return string[]
*/
private function filterOurShortClasses(array $classNames) : array
{
return \array_filter($classNames, static function (string $className) : bool {
return \strpos($className, '\\') !== \false;
});
}
}

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '0.15.0';
public const PACKAGE_VERSION = 'f4ff24c16110daa22312f443fd25e88060e17123';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-12-05 00:29:49';
public const RELEASE_DATE = '2022-12-05 10:58:57';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

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

View File

@ -1849,12 +1849,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "b16d96b5fe76a1b93b9b0e61bb7b80e724597d2f"
"reference": "ddad9972a6c261e693d04e13f04b63a39e8bff9d"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/b16d96b5fe76a1b93b9b0e61bb7b80e724597d2f",
"reference": "b16d96b5fe76a1b93b9b0e61bb7b80e724597d2f",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/ddad9972a6c261e693d04e13f04b63a39e8bff9d",
"reference": "ddad9972a6c261e693d04e13f04b63a39e8bff9d",
"shasum": ""
},
"require": {
@ -1864,10 +1864,11 @@
"rector\/rector": "<0.13"
},
"require-dev": {
"phpstan\/extension-installer": "^1.1",
"phpstan\/phpstan": "^1.8",
"phpstan\/phpstan-strict-rules": "^1.2",
"phpstan\/phpstan-webmozart-assert": "^1.1",
"phpstan\/extension-installer": "^1.2",
"phpstan\/phpdoc-parser": "1.13.1 as 1.14",
"phpstan\/phpstan": "^1.9",
"phpstan\/phpstan-strict-rules": "^1.4",
"phpstan\/phpstan-webmozart-assert": "^1.2",
"phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.6",
"rector\/rector-debugging": "dev-main",
@ -1880,7 +1881,7 @@
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-12-04T13:35:50+00:00",
"time": "2022-12-05T10:25:44+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 bf394ee'), '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 b16d96b'), '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 9ea5f62'), '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 3d0d84d'), '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 d789b90'));
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 bf394ee'), '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 ddad997'), '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 9ea5f62'), '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 3d0d84d'), '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 d789b90'));
private function __construct()
{
}

View File

@ -7,10 +7,11 @@
"php": ">=8.1"
},
"require-dev": {
"phpstan\/extension-installer": "^1.1",
"phpstan\/phpstan": "^1.8",
"phpstan\/phpstan-strict-rules": "^1.2",
"phpstan\/phpstan-webmozart-assert": "^1.1",
"phpstan\/extension-installer": "^1.2",
"phpstan\/phpstan": "^1.9",
"phpstan\/phpdoc-parser": "1.13.1 as 1.14",
"phpstan\/phpstan-strict-rules": "^1.4",
"phpstan\/phpstan-webmozart-assert": "^1.2",
"phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.6",
"rector\/rector-debugging": "dev-main",

View File

@ -12,7 +12,6 @@ use PHPStan\Type\FloatType;
use PHPStan\Type\IntegerType;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\PhpParser\AstResolver;
use Rector\NodeTypeResolver\NodeTypeResolver;
final class EnumAnalyzer