From 9a455bf300722a1aaf70f44d8b38ddd247a5477f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 19 May 2024 17:16:04 +0000 Subject: [PATCH] Updated Rector to commit 7d65537690d8d788b595b46f026920b4b17eaaf5 https://github.com/rectorphp/rector-src/commit/7d65537690d8d788b595b46f026920b4b17eaaf5 Fix few static errors (#5899) --- rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php | 4 ++++ src/Application/VersionResolver.php | 4 ++-- src/Caching/Cache.php | 3 +++ src/NodeNameResolver/NodeNameResolver.php | 2 ++ .../NodeFactory/PhpAttributeGroupFactory.php | 4 ++++ vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- vendor/scoper-autoload.php | 2 +- 9 files changed, 26 insertions(+), 13 deletions(-) diff --git a/rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php b/rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php index ba39916e1b3..4daa42508f3 100644 --- a/rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php +++ b/rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php @@ -15,6 +15,7 @@ use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Property; use PHPStan\Reflection\ReflectionProvider; use Rector\NodeNameResolver\NodeNameResolver; +use Rector\Php81\Enum\AttributeName; use Rector\PhpAttribute\Enum\DocTagNodeState; final class PhpAttributeAnalyzer { @@ -48,6 +49,9 @@ final class PhpAttributeAnalyzer } return \false; } + /** + * @param AttributeName::* $attributeClass + */ public function hasInheritedPhpAttribute(Class_ $class, string $attributeClass) : bool { $className = (string) $this->nodeNameResolver->getName($class); diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 0d0641255e0..0eb156b6348 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 = '196b2d0947a0dbec176209113f52e82ac5673e2b'; + public const PACKAGE_VERSION = '7d65537690d8d788b595b46f026920b4b17eaaf5'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-05-19 18:07:08'; + public const RELEASE_DATE = '2024-05-19 19:12:26'; /** * @var int */ diff --git a/src/Caching/Cache.php b/src/Caching/Cache.php index 1bebddbb3e0..c3f4c7983f2 100644 --- a/src/Caching/Cache.php +++ b/src/Caching/Cache.php @@ -4,6 +4,7 @@ declare (strict_types=1); namespace Rector\Caching; use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; +use Rector\Caching\Enum\CacheKey; final class Cache { /** @@ -16,6 +17,7 @@ final class Cache $this->cacheStorage = $cacheStorage; } /** + * @param CacheKey::* $variableKey * @return mixed|null */ public function load(string $key, string $variableKey) @@ -23,6 +25,7 @@ final class Cache return $this->cacheStorage->load($key, $variableKey); } /** + * @param CacheKey::* $variableKey * @param mixed $data */ public function save(string $key, string $variableKey, $data) : void diff --git a/src/NodeNameResolver/NodeNameResolver.php b/src/NodeNameResolver/NodeNameResolver.php index 03896b366a9..99de363eb85 100644 --- a/src/NodeNameResolver/NodeNameResolver.php +++ b/src/NodeNameResolver/NodeNameResolver.php @@ -26,6 +26,7 @@ use Rector\Exception\ShouldNotHappenException; use Rector\NodeAnalyzer\CallAnalyzer; use Rector\NodeNameResolver\Contract\NodeNameResolverInterface; use Rector\NodeTypeResolver\Node\AttributeKey; +use Rector\ValueObject\MethodName; final class NodeNameResolver { /** @@ -78,6 +79,7 @@ final class NodeNameResolver } /** * @param Node|Node[] $node + * @param MethodName::*|string $name */ public function isName($node, string $name) : bool { diff --git a/src/PhpAttribute/NodeFactory/PhpAttributeGroupFactory.php b/src/PhpAttribute/NodeFactory/PhpAttributeGroupFactory.php index 495829b7966..fc6fa0b02e2 100644 --- a/src/PhpAttribute/NodeFactory/PhpAttributeGroupFactory.php +++ b/src/PhpAttribute/NodeFactory/PhpAttributeGroupFactory.php @@ -17,6 +17,7 @@ use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode; use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode; use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\Php80\ValueObject\AnnotationToAttribute; +use Rector\Php81\Enum\AttributeName; use Rector\PhpAttribute\AnnotationToAttributeMapper; use Rector\PhpAttribute\AttributeArrayNameInliner; /** @@ -55,6 +56,9 @@ final class PhpAttributeGroupFactory { return $this->createFromClass($annotationToAttribute->getAttributeClass()); } + /** + * @param AttributeName::*|string $attributeClass + */ public function createFromClass(string $attributeClass) : AttributeGroup { $fullyQualified = new FullyQualified($attributeClass); diff --git a/vendor/autoload.php b/vendor/autoload.php index d46284500f7..586bf994f81 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 ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da::getLoader(); +return ComposerAutoloaderInit8f3085135f9c0dec79e149b0c0400440::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index b23a80e7dfa..6ba699611f2 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da +class ComposerAutoloaderInit8f3085135f9c0dec79e149b0c0400440 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8f3085135f9c0dec79e149b0c0400440', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8f3085135f9c0dec79e149b0c0400440', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit8f3085135f9c0dec79e149b0c0400440::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit8f3085135f9c0dec79e149b0c0400440::$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 cf15907aeb9..767f7a282c5 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da +class ComposerStaticInit8f3085135f9c0dec79e149b0c0400440 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2729,9 +2729,9 @@ class ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit324dac9f89c2a1b2a5d32f56900fd8da::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit8f3085135f9c0dec79e149b0c0400440::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit8f3085135f9c0dec79e149b0c0400440::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit8f3085135f9c0dec79e149b0c0400440::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 63c7b717268..192e9cf906a 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -30,7 +30,7 @@ if (!function_exists('humbug_phpscoper_expose_class')) { } } humbug_phpscoper_expose_class('AutoloadIncluder', 'RectorPrefix202405\AutoloadIncluder'); -humbug_phpscoper_expose_class('ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da', 'RectorPrefix202405\ComposerAutoloaderInit324dac9f89c2a1b2a5d32f56900fd8da'); +humbug_phpscoper_expose_class('ComposerAutoloaderInit8f3085135f9c0dec79e149b0c0400440', 'RectorPrefix202405\ComposerAutoloaderInit8f3085135f9c0dec79e149b0c0400440'); humbug_phpscoper_expose_class('Product', 'RectorPrefix202405\Product'); // Function aliases. For more information see: