From 0222a6ac5063019e1210395787f0425db05336a0 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 10 Jun 2023 06:56:35 +0000 Subject: [PATCH] Updated Rector to commit c6a5b762dea6a71041b413554baa26f4b2400a11 https://github.com/rectorphp/rector-src/commit/c6a5b762dea6a71041b413554baa26f4b2400a11 StringClassNameToClassConstantRector: cheap checks first (#4151) --- .../String_/StringClassNameToClassConstantRector.php | 6 +++--- src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php index c0cb2b470f4..defcb49d86c 100644 --- a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php +++ b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php @@ -126,9 +126,6 @@ CODE_SAMPLE } private function shouldSkip(string $classLikeName) : bool { - if (!$this->reflectionProvider->hasClass($classLikeName)) { - return \true; - } // skip short class names, mostly invalid use of strings if (\strpos($classLikeName, '\\') === \false) { return \true; @@ -137,6 +134,9 @@ CODE_SAMPLE if (\ctype_lower($classLikeName[0])) { return \true; } + if (!$this->reflectionProvider->hasClass($classLikeName)) { + return \true; + } foreach ($this->classesToSkip as $classToSkip) { if ($this->nodeNameResolver->isStringName($classLikeName, $classToSkip)) { return \true; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index ea3d67686f6..aaf16cf90b7 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'bc61ac2b0a95c93a557ccfe4f371f361ec09ab2c'; + public const PACKAGE_VERSION = 'c6a5b762dea6a71041b413554baa26f4b2400a11'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-06-10 06:29:57'; + public const RELEASE_DATE = '2023-06-10 07:52:38'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index b5f8e2733ff..997ac4efa17 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit4f4ac2e25f38d6f7f362f62fcaafd8d9::getLoader(); +return ComposerAutoloaderInitcba6ec738ed83b7c2fa2b12d2e80cd72::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 9bff7a10720..fbe4b927cbb 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit4f4ac2e25f38d6f7f362f62fcaafd8d9 +class ComposerAutoloaderInitcba6ec738ed83b7c2fa2b12d2e80cd72 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit4f4ac2e25f38d6f7f362f62fcaafd8d9 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit4f4ac2e25f38d6f7f362f62fcaafd8d9', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitcba6ec738ed83b7c2fa2b12d2e80cd72', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit4f4ac2e25f38d6f7f362f62fcaafd8d9', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitcba6ec738ed83b7c2fa2b12d2e80cd72', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitcba6ec738ed83b7c2fa2b12d2e80cd72::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitcba6ec738ed83b7c2fa2b12d2e80cd72::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 0024fbd87bd..3095105e055 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9 +class ComposerStaticInitcba6ec738ed83b7c2fa2b12d2e80cd72 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3128,9 +3128,9 @@ class ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit4f4ac2e25f38d6f7f362f62fcaafd8d9::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitcba6ec738ed83b7c2fa2b12d2e80cd72::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitcba6ec738ed83b7c2fa2b12d2e80cd72::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitcba6ec738ed83b7c2fa2b12d2e80cd72::$classMap; }, null, ClassLoader::class); }