Updated Rector to commit 2667f35cc72a6f7da454635a24bdc3ede61082ae

2667f35cc7 Improve ReturnTypeWillChangeRector to handle any method of defined type; move PhpDocFromTypeDeclarationDecorator to Downgrade rules (#2754)
This commit is contained in:
Tomas Votruba 2022-08-11 15:03:59 +00:00
parent 26bacab80c
commit f6f9dadfe8
10 changed files with 97 additions and 264 deletions

View File

@ -8696,11 +8696,13 @@ Add #[\ReturnTypeWillChange] attribute to configured instanceof class with metho
```php
use Rector\Config\RectorConfig;
use Rector\Transform\Rector\ClassMethod\ReturnTypeWillChangeRector;
use Rector\Transform\ValueObject\ClassMethodReference;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(ReturnTypeWillChangeRector::class, [
ArrayAccess::class => ['offsetGet'],
]);
$rectorConfig->ruleWithConfiguration(
ReturnTypeWillChangeRector::class,
[new ClassMethodReference('ArrayAccess', 'offsetGet')]
);
};
```

View File

@ -1,213 +0,0 @@
<?php
declare (strict_types=1);
namespace Rector\BetterPhpDocParser\PhpDocParser;
use PhpParser\Node\ComplexType;
use PhpParser\Node\Expr\ArrowFunction;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Interface_;
use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use PHPStan\Type\UnionType;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer;
use Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory;
use Rector\StaticTypeMapper\StaticTypeMapper;
use ReturnTypeWillChange;
/**
* @see https://wiki.php.net/rfc/internal_method_return_types#proposal
*/
final class PhpDocFromTypeDeclarationDecorator
{
/**
* @var class-string<ReturnTypeWillChange>
*/
public const RETURN_TYPE_WILL_CHANGE_ATTRIBUTE = 'ReturnTypeWillChange';
/**
* @var array<string, array<string, string[]>>
*/
public const ADD_RETURN_TYPE_WILL_CHANGE = ['PHPStan\\Type\\MixedType' => ['ArrayAccess' => ['offsetGet']], 'Rector\\StaticTypeMapper\\ValueObject\\Type\\FullyQualifiedObjectType' => ['ArrayAccess' => ['getIterator']]];
/**
* @readonly
* @var \Rector\StaticTypeMapper\StaticTypeMapper
*/
private $staticTypeMapper;
/**
* @readonly
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
*/
private $phpDocInfoFactory;
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
/**
* @readonly
* @var \Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger
*/
private $phpDocTypeChanger;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory
*/
private $phpAttributeGroupFactory;
/**
* @readonly
* @var \Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer
*/
private $phpAttributeAnalyzer;
public function __construct(StaticTypeMapper $staticTypeMapper, PhpDocInfoFactory $phpDocInfoFactory, NodeNameResolver $nodeNameResolver, PhpDocTypeChanger $phpDocTypeChanger, BetterNodeFinder $betterNodeFinder, PhpAttributeGroupFactory $phpAttributeGroupFactory, PhpAttributeAnalyzer $phpAttributeAnalyzer)
{
$this->staticTypeMapper = $staticTypeMapper;
$this->phpDocInfoFactory = $phpDocInfoFactory;
$this->nodeNameResolver = $nodeNameResolver;
$this->phpDocTypeChanger = $phpDocTypeChanger;
$this->betterNodeFinder = $betterNodeFinder;
$this->phpAttributeGroupFactory = $phpAttributeGroupFactory;
$this->phpAttributeAnalyzer = $phpAttributeAnalyzer;
}
/**
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $functionLike
*/
public function decorate($functionLike) : void
{
if ($functionLike->returnType === null) {
return;
}
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($functionLike);
$returnTagValueNode = $phpDocInfo->getReturnTagValue();
$type = $returnTagValueNode instanceof ReturnTagValueNode ? $this->staticTypeMapper->mapPHPStanPhpDocTypeToPHPStanType($returnTagValueNode, $functionLike->returnType) : $this->staticTypeMapper->mapPhpParserNodePHPStanType($functionLike->returnType);
$this->phpDocTypeChanger->changeReturnType($phpDocInfo, $type);
$functionLike->returnType = null;
if (!$functionLike instanceof ClassMethod) {
return;
}
$classLike = $this->betterNodeFinder->findParentByTypes($functionLike, [Class_::class, Interface_::class]);
if (!$classLike instanceof ClassLike) {
return;
}
if (!$this->isRequireReturnTypeWillChange(\get_class($type), $classLike, $functionLike)) {
return;
}
$attributeGroup = $this->phpAttributeGroupFactory->createFromClass(self::RETURN_TYPE_WILL_CHANGE_ATTRIBUTE);
$functionLike->attrGroups[] = $attributeGroup;
}
/**
* @param array<class-string<Type>> $requiredTypes
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $functionLike
*/
public function decorateParam(Param $param, $functionLike, array $requiredTypes) : void
{
if ($param->type === null) {
return;
}
$type = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
if (!$this->isMatchingType($type, $requiredTypes)) {
return;
}
$this->moveParamTypeToParamDoc($functionLike, $param, $type);
}
/**
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $functionLike
*/
public function decorateParamWithSpecificType(Param $param, $functionLike, Type $requireType) : void
{
if ($param->type === null) {
return;
}
if (!$this->isTypeMatch($param->type, $requireType)) {
return;
}
$type = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
$this->moveParamTypeToParamDoc($functionLike, $param, $type);
}
/**
* @return bool True if node was changed
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $functionLike
*/
public function decorateReturnWithSpecificType($functionLike, Type $requireType) : bool
{
if ($functionLike->returnType === null) {
return \false;
}
if (!$this->isTypeMatch($functionLike->returnType, $requireType)) {
return \false;
}
$this->decorate($functionLike);
return \true;
}
private function isRequireReturnTypeWillChange(string $type, ClassLike $classLike, ClassMethod $classMethod) : bool
{
if (!\array_key_exists($type, self::ADD_RETURN_TYPE_WILL_CHANGE)) {
return \false;
}
$className = (string) $this->nodeNameResolver->getName($classLike);
$objectClass = new ObjectType($className);
$methodName = $this->nodeNameResolver->getName($classMethod);
foreach (self::ADD_RETURN_TYPE_WILL_CHANGE[$type] as $class => $methods) {
$objectClassConfig = new ObjectType($class);
if (!$objectClassConfig->isSuperTypeOf($objectClass)->yes()) {
continue;
}
if (!\in_array($methodName, $methods, \true)) {
continue;
}
if ($this->phpAttributeAnalyzer->hasPhpAttribute($classMethod, self::RETURN_TYPE_WILL_CHANGE_ATTRIBUTE)) {
continue;
}
return \true;
}
return \false;
}
/**
* @param \PhpParser\Node\ComplexType|\PhpParser\Node\Identifier|\PhpParser\Node\Name $typeNode
*/
private function isTypeMatch($typeNode, Type $requireType) : bool
{
$returnType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($typeNode);
// cover nullable union types
if ($returnType instanceof UnionType) {
$returnType = TypeCombinator::removeNull($returnType);
}
if ($returnType instanceof ObjectType) {
return $returnType->equals($requireType);
}
return \get_class($returnType) === \get_class($requireType);
}
/**
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure|\PhpParser\Node\Expr\ArrowFunction $functionLike
*/
private function moveParamTypeToParamDoc($functionLike, Param $param, Type $type) : void
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($functionLike);
$paramName = $this->nodeNameResolver->getName($param);
$this->phpDocTypeChanger->changeParamType($phpDocInfo, $type, $param, $paramName);
$param->type = null;
}
/**
* @param array<class-string<Type>> $requiredTypes
*/
private function isMatchingType(Type $type, array $requiredTypes) : bool
{
return \in_array(\get_class($type), $requiredTypes, \true);
}
}

View File

@ -0,0 +1,14 @@
<?php
declare (strict_types=1);
namespace Rector\Php81\Enum;
final class AttributeName
{
/**
* Available since PHP 8.1
* @see https://php.watch/versions/8.1/ReturnTypeWillChange
* @var string
*/
public const RETURN_TYPE_WILL_CHANGE = 'ReturnTypeWillChange';
}

View File

@ -8,25 +8,27 @@ use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Interface_;
use PHPStan\Type\ObjectType;
use Rector\BetterPhpDocParser\PhpDocParser\PhpDocFromTypeDeclarationDecorator;
use Rector\Core\Contract\Rector\AllowEmptyConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Reflection\ReflectionResolver;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer;
use Rector\Php81\Enum\AttributeName;
use Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory;
use Rector\Transform\ValueObject\ClassMethodReference;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix202208\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Transform\Rector\ClassMethod\ReturnTypeWillChangeRector\ReturnTypeWillChangeRectorTest
*/
final class ReturnTypeWillChangeRector extends AbstractRector implements AllowEmptyConfigurableRectorInterface, MinPhpVersionInterface
{
/**
* @var array<string, string[]>
* @var ClassMethodReference[]
*/
private $classMethodsOfClass = [];
private $returnTypeChangedClassMethodReferences = [];
/**
* @readonly
* @var \Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer
@ -37,10 +39,18 @@ final class ReturnTypeWillChangeRector extends AbstractRector implements AllowEm
* @var \Rector\PhpAttribute\NodeFactory\PhpAttributeGroupFactory
*/
private $phpAttributeGroupFactory;
public function __construct(PhpAttributeAnalyzer $phpAttributeAnalyzer, PhpAttributeGroupFactory $phpAttributeGroupFactory)
/**
* @readonly
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;
public function __construct(PhpAttributeAnalyzer $phpAttributeAnalyzer, PhpAttributeGroupFactory $phpAttributeGroupFactory, ReflectionResolver $reflectionResolver)
{
$this->phpAttributeAnalyzer = $phpAttributeAnalyzer;
$this->phpAttributeGroupFactory = $phpAttributeGroupFactory;
$this->reflectionResolver = $reflectionResolver;
$this->returnTypeChangedClassMethodReferences[] = new ClassMethodReference('ArrayAccess', 'getIterator');
$this->returnTypeChangedClassMethodReferences[] = new ClassMethodReference('ArrayAccess', 'offsetGet');
}
public function getRuleDefinition() : RuleDefinition
{
@ -61,7 +71,7 @@ class SomeClass implements ArrayAccess
}
}
CODE_SAMPLE
, ['ArrayAccess' => ['offsetGet']])]);
, [new ClassMethodReference('ArrayAccess', 'offsetGet')])]);
}
/**
* @return array<class-string<Node>>
@ -75,9 +85,10 @@ CODE_SAMPLE
*/
public function refactor(Node $node) : ?Node
{
if ($this->phpAttributeAnalyzer->hasPhpAttribute($node, 'ReturnTypeWillChange')) {
if ($this->phpAttributeAnalyzer->hasPhpAttribute($node, AttributeName::RETURN_TYPE_WILL_CHANGE)) {
return null;
}
// the return type is known, no need to add attribute
if ($node->returnType !== null) {
return null;
}
@ -85,22 +96,17 @@ CODE_SAMPLE
if (!$classLike instanceof ClassLike) {
return null;
}
/** @var array<string, string[]> $classMethodsOfClass */
$classMethodsOfClass = \array_merge_recursive($this->resolveDefaultConfig(), $this->classMethodsOfClass);
$className = (string) $this->nodeNameResolver->getName($classLike);
$objectType = new ObjectType($className);
$methodName = $this->nodeNameResolver->getName($node);
$classReflection = $this->reflectionResolver->resolveClassAndAnonymousClass($classLike);
$methodName = $node->name->toString();
$hasChanged = \false;
foreach ($classMethodsOfClass as $class => $methods) {
$configuredClassObjectType = new ObjectType($class);
if (!$configuredClassObjectType->isSuperTypeOf($objectType)->yes()) {
foreach ($this->returnTypeChangedClassMethodReferences as $returnTypeChangedClassMethodReference) {
if (!$classReflection->isSubclassOf($returnTypeChangedClassMethodReference->getClass())) {
continue;
}
if (!\in_array($methodName, $methods, \true)) {
if ($returnTypeChangedClassMethodReference->getMethod() !== $methodName) {
continue;
}
$attributeGroup = $this->phpAttributeGroupFactory->createFromClass(PhpDocFromTypeDeclarationDecorator::RETURN_TYPE_WILL_CHANGE_ATTRIBUTE);
$node->attrGroups[] = $attributeGroup;
$node->attrGroups[] = $this->phpAttributeGroupFactory->createFromClass(AttributeName::RETURN_TYPE_WILL_CHANGE);
$hasChanged = \true;
break;
}
@ -114,23 +120,11 @@ CODE_SAMPLE
*/
public function configure(array $configuration) : void
{
$this->classMethodsOfClass = $configuration;
Assert::allIsInstanceOf($configuration, ClassMethodReference::class);
$this->returnTypeChangedClassMethodReferences = \array_merge($this->returnTypeChangedClassMethodReferences, $configuration);
}
public function provideMinPhpVersion() : int
{
return PhpVersionFeature::RETURN_TYPE_WILL_CHANGE_ATTRIBUTE;
}
/**
* @return array<string, string[]>
*/
private function resolveDefaultConfig() : array
{
$configuration = [];
foreach (PhpDocFromTypeDeclarationDecorator::ADD_RETURN_TYPE_WILL_CHANGE as $classWithMethods) {
foreach ($classWithMethods as $class => $methods) {
$configuration[$class] = \array_merge($configuration[$class] ?? [], $methods);
}
}
return $configuration;
}
}

View File

@ -0,0 +1,34 @@
<?php
declare (strict_types=1);
namespace Rector\Transform\ValueObject;
use Rector\Core\Validation\RectorAssert;
final class ClassMethodReference
{
/**
* @readonly
* @var string
*/
private $class;
/**
* @readonly
* @var string
*/
private $method;
public function __construct(string $class, string $method)
{
$this->class = $class;
$this->method = $method;
RectorAssert::className($class);
RectorAssert::methodName($method);
}
public function getClass() : string
{
return $this->class;
}
public function getMethod() : string
{
return $this->method;
}
}

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'c0070b1d30a0040e3e58724ac1b3b339e168dcb5';
public const PACKAGE_VERSION = '2667f35cc72a6f7da454635a24bdc3ede61082ae';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-08-10 13:07:57';
public const RELEASE_DATE = '2022-08-11 16:58:37';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -1221,7 +1221,6 @@ return array(
'Rector\\BetterPhpDocParser\\PhpDocParser\\ClassAnnotationMatcher' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\ConstExprClassNameDecorator' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/ConstExprClassNameDecorator.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\DoctrineAnnotationDecorator' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\PhpDocFromTypeDeclarationDecorator' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/PhpDocFromTypeDeclarationDecorator.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\StaticDoctrineAnnotationParser' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\StaticDoctrineAnnotationParser\\ArrayParser' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/ArrayParser.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\StaticDoctrineAnnotationParser\\PlainValueParser' => $baseDir . '/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/PlainValueParser.php',
@ -2400,6 +2399,7 @@ return array(
'Rector\\Php80\\ValueObject\\DoctrineTagAndAnnotationToAttribute' => $baseDir . '/rules/Php80/ValueObject/DoctrineTagAndAnnotationToAttribute.php',
'Rector\\Php80\\ValueObject\\PropertyPromotionCandidate' => $baseDir . '/rules/Php80/ValueObject/PropertyPromotionCandidate.php',
'Rector\\Php80\\ValueObject\\StrStartsWith' => $baseDir . '/rules/Php80/ValueObject/StrStartsWith.php',
'Rector\\Php81\\Enum\\AttributeName' => $baseDir . '/rules/Php81/Enum/AttributeName.php',
'Rector\\Php81\\NodeAnalyzer\\ComplexNewAnalyzer' => $baseDir . '/rules/Php81/NodeAnalyzer/ComplexNewAnalyzer.php',
'Rector\\Php81\\NodeAnalyzer\\EnumConstListClassDetector' => $baseDir . '/rules/Php81/NodeAnalyzer/EnumConstListClassDetector.php',
'Rector\\Php81\\NodeFactory\\ClassFromEnumFactory' => $baseDir . '/rules/Php81/NodeFactory/ClassFromEnumFactory.php',
@ -2795,6 +2795,7 @@ return array(
'Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall' => $baseDir . '/rules/Transform/ValueObject/ArgumentFuncCallToMethodCall.php',
'Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall' => $baseDir . '/rules/Transform/ValueObject/ArrayFuncCallToMethodCall.php',
'Rector\\Transform\\ValueObject\\AttributeKeyToClassConstFetch' => $baseDir . '/rules/Transform/ValueObject/AttributeKeyToClassConstFetch.php',
'Rector\\Transform\\ValueObject\\ClassMethodReference' => $baseDir . '/rules/Transform/ValueObject/ClassMethodReference.php',
'Rector\\Transform\\ValueObject\\DimFetchAssignToMethodCall' => $baseDir . '/rules/Transform/ValueObject/DimFetchAssignToMethodCall.php',
'Rector\\Transform\\ValueObject\\FuncCallToMethodCall' => $baseDir . '/rules/Transform/ValueObject/FuncCallToMethodCall.php',
'Rector\\Transform\\ValueObject\\FuncCallToStaticCall' => $baseDir . '/rules/Transform/ValueObject/FuncCallToStaticCall.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitcf9debef211b55f4078227337a9383a8
class ComposerAutoloaderInit18d3aa3277e59cddf7025994207a8101
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitcf9debef211b55f4078227337a9383a8
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitcf9debef211b55f4078227337a9383a8', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit18d3aa3277e59cddf7025994207a8101', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitcf9debef211b55f4078227337a9383a8', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit18d3aa3277e59cddf7025994207a8101', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitcf9debef211b55f4078227337a9383a8::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit18d3aa3277e59cddf7025994207a8101::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitcf9debef211b55f4078227337a9383a8::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit18d3aa3277e59cddf7025994207a8101::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirecf9debef211b55f4078227337a9383a8($fileIdentifier, $file);
composerRequire18d3aa3277e59cddf7025994207a8101($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitcf9debef211b55f4078227337a9383a8
* @param string $file
* @return void
*/
function composerRequirecf9debef211b55f4078227337a9383a8($fileIdentifier, $file)
function composerRequire18d3aa3277e59cddf7025994207a8101($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 ComposerStaticInitcf9debef211b55f4078227337a9383a8
class ComposerStaticInit18d3aa3277e59cddf7025994207a8101
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -1518,7 +1518,6 @@ class ComposerStaticInitcf9debef211b55f4078227337a9383a8
'Rector\\BetterPhpDocParser\\PhpDocParser\\ClassAnnotationMatcher' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/ClassAnnotationMatcher.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\ConstExprClassNameDecorator' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/ConstExprClassNameDecorator.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\DoctrineAnnotationDecorator' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\PhpDocFromTypeDeclarationDecorator' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/PhpDocFromTypeDeclarationDecorator.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\StaticDoctrineAnnotationParser' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\StaticDoctrineAnnotationParser\\ArrayParser' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/ArrayParser.php',
'Rector\\BetterPhpDocParser\\PhpDocParser\\StaticDoctrineAnnotationParser\\PlainValueParser' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser/PlainValueParser.php',
@ -2697,6 +2696,7 @@ class ComposerStaticInitcf9debef211b55f4078227337a9383a8
'Rector\\Php80\\ValueObject\\DoctrineTagAndAnnotationToAttribute' => __DIR__ . '/../..' . '/rules/Php80/ValueObject/DoctrineTagAndAnnotationToAttribute.php',
'Rector\\Php80\\ValueObject\\PropertyPromotionCandidate' => __DIR__ . '/../..' . '/rules/Php80/ValueObject/PropertyPromotionCandidate.php',
'Rector\\Php80\\ValueObject\\StrStartsWith' => __DIR__ . '/../..' . '/rules/Php80/ValueObject/StrStartsWith.php',
'Rector\\Php81\\Enum\\AttributeName' => __DIR__ . '/../..' . '/rules/Php81/Enum/AttributeName.php',
'Rector\\Php81\\NodeAnalyzer\\ComplexNewAnalyzer' => __DIR__ . '/../..' . '/rules/Php81/NodeAnalyzer/ComplexNewAnalyzer.php',
'Rector\\Php81\\NodeAnalyzer\\EnumConstListClassDetector' => __DIR__ . '/../..' . '/rules/Php81/NodeAnalyzer/EnumConstListClassDetector.php',
'Rector\\Php81\\NodeFactory\\ClassFromEnumFactory' => __DIR__ . '/../..' . '/rules/Php81/NodeFactory/ClassFromEnumFactory.php',
@ -3092,6 +3092,7 @@ class ComposerStaticInitcf9debef211b55f4078227337a9383a8
'Rector\\Transform\\ValueObject\\ArgumentFuncCallToMethodCall' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/ArgumentFuncCallToMethodCall.php',
'Rector\\Transform\\ValueObject\\ArrayFuncCallToMethodCall' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/ArrayFuncCallToMethodCall.php',
'Rector\\Transform\\ValueObject\\AttributeKeyToClassConstFetch' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/AttributeKeyToClassConstFetch.php',
'Rector\\Transform\\ValueObject\\ClassMethodReference' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/ClassMethodReference.php',
'Rector\\Transform\\ValueObject\\DimFetchAssignToMethodCall' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/DimFetchAssignToMethodCall.php',
'Rector\\Transform\\ValueObject\\FuncCallToMethodCall' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/FuncCallToMethodCall.php',
'Rector\\Transform\\ValueObject\\FuncCallToStaticCall' => __DIR__ . '/../..' . '/rules/Transform/ValueObject/FuncCallToStaticCall.php',
@ -3249,9 +3250,9 @@ class ComposerStaticInitcf9debef211b55f4078227337a9383a8
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitcf9debef211b55f4078227337a9383a8::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcf9debef211b55f4078227337a9383a8::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitcf9debef211b55f4078227337a9383a8::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit18d3aa3277e59cddf7025994207a8101::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit18d3aa3277e59cddf7025994207a8101::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit18d3aa3277e59cddf7025994207a8101::$classMap;
}, null, ClassLoader::class);
}