From 07746f72b01891feaacfa6b6314f62283f5698de Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 5 Oct 2022 19:14:06 +0000 Subject: [PATCH] Updated Rector to commit 0c2b4f7732587b7ed55b3279a7807c09162ad010 https://github.com/rectorphp/rector-src/commit/0c2b4f7732587b7ed55b3279a7807c09162ad010 [Core] Set compatible with latest BetterReflection usage to handle assert( > 0) notice (#2978) --- src/Application/VersionResolver.php | 4 ++-- .../SourceLocator/RenamedClassesSourceLocator.php | 7 +------ vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++++++------- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 3410627975f..dc0ae82414c 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -17,12 +17,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'd6b984564dc6ea97b294e54ebb4bfdad76877063'; + public const PACKAGE_VERSION = '0c2b4f7732587b7ed55b3279a7807c09162ad010'; /** * @api * @var string */ - public const RELEASE_DATE = '2022-10-05 17:28:42'; + public const RELEASE_DATE = '2022-10-05 21:09:39'; /** * @var int */ diff --git a/src/StaticReflection/SourceLocator/RenamedClassesSourceLocator.php b/src/StaticReflection/SourceLocator/RenamedClassesSourceLocator.php index 5ae6a401553..a6fc09a9897 100644 --- a/src/StaticReflection/SourceLocator/RenamedClassesSourceLocator.php +++ b/src/StaticReflection/SourceLocator/RenamedClassesSourceLocator.php @@ -8,9 +8,7 @@ use PHPStan\BetterReflection\Identifier\Identifier; use PHPStan\BetterReflection\Identifier\IdentifierType; use PHPStan\BetterReflection\Reflection\Reflection; use PHPStan\BetterReflection\Reflection\ReflectionClass; -use PHPStan\BetterReflection\Reflector\ClassReflector; use PHPStan\BetterReflection\Reflector\Reflector; -use PHPStan\BetterReflection\SourceLocator\Located\LocatedSource; use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator; use Rector\Core\Configuration\RenamedClassesDataCollector; /** @@ -37,7 +35,6 @@ final class RenamedClassesSourceLocator implements SourceLocator if ($identifierName !== $oldClass) { continue; } - // inspired at https://github.com/phpstan/phpstan-src/blob/a9dd9af959fb0c1e0a09d4850f78e05e8dff3d91/src/Reflection/BetterReflection/BetterReflectionProvider.php#L220-L225 return $this->createFakeReflectionClassFromClassName($oldClass); } return null; @@ -53,8 +50,6 @@ final class RenamedClassesSourceLocator implements SourceLocator { $classBuilder = new Class_($oldClass); $class = $classBuilder->getNode(); - $fakeLocatedSource = new LocatedSource('virtual', null); - $classReflector = new ClassReflector($this); - return ReflectionClass::createFromNode($classReflector, $class, $fakeLocatedSource); + return ReflectionClass::createFromInstance($class); } } diff --git a/vendor/autoload.php b/vendor/autoload.php index 7af862582a8..8fe02cce7b9 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit08796dfb633ef1ce0f74b9295ae43d41::getLoader(); +return ComposerAutoloaderInite61f97ffaa20fa7dbd2d815f3d528466::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 27fc2b1c51b..91e466cef1c 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit08796dfb633ef1ce0f74b9295ae43d41 +class ComposerAutoloaderInite61f97ffaa20fa7dbd2d815f3d528466 { private static $loader; @@ -22,19 +22,19 @@ class ComposerAutoloaderInit08796dfb633ef1ce0f74b9295ae43d41 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit08796dfb633ef1ce0f74b9295ae43d41', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInite61f97ffaa20fa7dbd2d815f3d528466', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit08796dfb633ef1ce0f74b9295ae43d41', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInite61f97ffaa20fa7dbd2d815f3d528466', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInite61f97ffaa20fa7dbd2d815f3d528466::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInite61f97ffaa20fa7dbd2d815f3d528466::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire08796dfb633ef1ce0f74b9295ae43d41($fileIdentifier, $file); + composerRequiree61f97ffaa20fa7dbd2d815f3d528466($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ class ComposerAutoloaderInit08796dfb633ef1ce0f74b9295ae43d41 * @param string $file * @return void */ -function composerRequire08796dfb633ef1ce0f74b9295ae43d41($fileIdentifier, $file) +function composerRequiree61f97ffaa20fa7dbd2d815f3d528466($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 cc8fa701498..628b444acdd 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41 +class ComposerStaticInite61f97ffaa20fa7dbd2d815f3d528466 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3087,9 +3087,9 @@ class ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit08796dfb633ef1ce0f74b9295ae43d41::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInite61f97ffaa20fa7dbd2d815f3d528466::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInite61f97ffaa20fa7dbd2d815f3d528466::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInite61f97ffaa20fa7dbd2d815f3d528466::$classMap; }, null, ClassLoader::class); }