Updated Rector to commit e539072713

e539072713 [PHP 8.0] Add DoctrineAnnotationClassToAttributeRector (#78)
This commit is contained in:
Tomas Votruba 2021-05-20 23:00:54 +00:00
parent b6780f0f12
commit 8cfe98d5b7
17 changed files with 222 additions and 26 deletions

View File

@ -22,7 +22,11 @@ final class PhpAttributeGroupFactory
{
public function createFromSimpleTag(\Rector\Php80\ValueObject\AnnotationToAttribute $annotationToAttribute) : \PhpParser\Node\AttributeGroup
{
$fullyQualified = new \PhpParser\Node\Name\FullyQualified($annotationToAttribute->getAttributeClass());
return $this->createFromClass($annotationToAttribute->getAttributeClass());
}
public function createFromClass(string $attributeClass) : \PhpParser\Node\AttributeGroup
{
$fullyQualified = new \PhpParser\Node\Name\FullyQualified($attributeClass);
$attribute = new \PhpParser\Node\Attribute($fullyQualified);
return new \PhpParser\Node\AttributeGroup([$attribute]);
}

View File

@ -18,6 +18,7 @@ use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Arguments\Rector\MethodCall\ValueObjectWrapArgRector\ValueObjectWrapArgRectorTest
*/
@ -90,7 +91,9 @@ CODE_SAMPLE
*/
public function configure(array $configuration) : void
{
$this->valueObjectWrapArgs = $configuration[self::VALUE_OBJECT_WRAP_ARGS] ?? [];
$valueObjectWrapArgs = $configuration[self::VALUE_OBJECT_WRAP_ARGS] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($valueObjectWrapArgs, \Rector\Arguments\ValueObject\ValueObjectWrapArg::class);
$this->valueObjectWrapArgs = $valueObjectWrapArgs;
}
private function wrapInNewWithType(\PHPStan\Type\ObjectType $newObjectType, \PhpParser\Node\Expr $expr) : \PhpParser\Node\Expr\New_
{

View File

@ -9,6 +9,7 @@ use Rector\Composer\ValueObject\PackageAndVersion;
use RectorPrefix20210520\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Composer\Rector\AddPackageToRequireComposerRector\AddPackageToRequireComposerRectorTest
*/
@ -57,6 +58,7 @@ CODE_SAMPLE
public function configure(array $configuration) : void
{
$packagesAndVersions = $configuration[self::PACKAGES_AND_VERSIONS] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($packagesAndVersions, \Rector\Composer\ValueObject\PackageAndVersion::class);
$this->versionGuard->validate($packagesAndVersions);
$this->packagesAndVersions = $packagesAndVersions;
}

View File

@ -9,6 +9,7 @@ use Rector\Composer\ValueObject\PackageAndVersion;
use RectorPrefix20210520\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Composer\Rector\AddPackageToRequireDevComposerRector\AddPackageToRequireDevComposerRectorTest
*/
@ -57,6 +58,7 @@ CODE_SAMPLE
public function configure(array $configuration) : void
{
$packagesAndVersions = $configuration[self::PACKAGES_AND_VERSIONS] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($packagesAndVersions, \Rector\Composer\ValueObject\PackageAndVersion::class);
$this->versionGuard->validate($packagesAndVersions);
$this->packageAndVersions = $packagesAndVersions;
}

View File

@ -9,6 +9,7 @@ use Rector\Composer\ValueObject\PackageAndVersion;
use RectorPrefix20210520\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Composer\Rector\ChangePackageVersionComposerRector\ChangePackageVersionComposerRectorTest
*/
@ -60,6 +61,7 @@ CODE_SAMPLE
public function configure(array $configuration) : void
{
$packagesAndVersions = $configuration[self::PACKAGES_AND_VERSIONS] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($packagesAndVersions, \Rector\Composer\ValueObject\PackageAndVersion::class);
$this->versionGuard->validate($packagesAndVersions);
$this->packagesAndVersions = $packagesAndVersions;
}

View File

@ -8,6 +8,7 @@ use Rector\Composer\ValueObject\RenamePackage;
use RectorPrefix20210520\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Composer\Rector\RenamePackageComposerRector\RenamePackageComposerRectorTest
*/
@ -57,6 +58,8 @@ CODE_SAMPLE
*/
public function configure(array $configuration) : void
{
$this->renamePackages = $configuration[self::RENAME_PACKAGES] ?? [];
$renamePackages = $configuration[self::RENAME_PACKAGES] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($renamePackages, \Rector\Composer\ValueObject\RenamePackage::class);
$this->renamePackages = $renamePackages;
}
}

View File

@ -9,6 +9,7 @@ use Rector\Composer\ValueObject\ReplacePackageAndVersion;
use RectorPrefix20210520\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Composer\Rector\ReplacePackageAndVersionComposerRector\ReplacePackageAndVersionComposerRectorTest
*/
@ -60,6 +61,7 @@ CODE_SAMPLE
public function configure(array $configuration) : void
{
$replacePackagesAndVersions = $configuration[self::REPLACE_PACKAGES_AND_VERSIONS] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($replacePackagesAndVersions, \Rector\Composer\ValueObject\ReplacePackageAndVersion::class);
$this->versionGuard->validate($replacePackagesAndVersions);
$this->replacePackagesAndVersions = $replacePackagesAndVersions;
}

View File

@ -0,0 +1,171 @@
<?php
declare (strict_types=1);
namespace Rector\Php80\Rector\Class_;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\AttributeGroup;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\BinaryOp\BitwiseOr;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Stmt\Class_;
use PHPStan\Type\MixedType;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
use Rector\Core\Rector\AbstractRector;
use Rector\PhpAttribute\Printer\PhpAttributeGroupFactory;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @changelog https://php.watch/articles/php-attributes#syntax
*
* @see https://github.com/doctrine/annotations/blob/1.13.x/lib/Doctrine/Common/Annotations/Annotation/Target.php
* @see https://github.com/doctrine/annotations/blob/c66f06b7c83e9a2a7523351a9d5a4b55f885e574/docs/en/custom.rst#annotation-required
*
* @see \Rector\Tests\Php80\Rector\Class_\DoctrineAnnotationClassToAttributeRector\DoctrineAnnotationClassToAttributeRectorTest
*/
final class DoctrineAnnotationClassToAttributeRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @see https://github.com/doctrine/annotations/blob/e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f/lib/Doctrine/Common/Annotations/Annotation/Target.php#L24-L29
* @var array<string, string>
*/
private const TARGET_TO_CONSTANT_MAP = [
'METHOD' => 'TARGET_METHOD',
'PROPERTY' => 'TARGET_PROPERTY',
'CLASS' => 'TARGET_CLASS',
'FUNCTION' => 'TARGET_FUNCTION',
'ALL' => 'TARGET_ALL',
// special case
'ANNOTATION' => 'TARGET_CLASS',
];
/**
* @var \Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover
*/
private $phpDocTagRemover;
/**
* @var \Rector\PhpAttribute\Printer\PhpAttributeGroupFactory
*/
private $phpAttributeGroupFactory;
public function __construct(\Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover $phpDocTagRemover, \Rector\PhpAttribute\Printer\PhpAttributeGroupFactory $phpAttributeGroupFactory)
{
$this->phpDocTagRemover = $phpDocTagRemover;
$this->phpAttributeGroupFactory = $phpAttributeGroupFactory;
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Refactor Doctrine @annotation annotated class to a PHP 8.0 attribute class', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target({"METHOD"})
*/
class SomeAnnotation
{
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
use Attribute;
#[Attribute(Attribute::TARGET_METHOD)]
class SomeAnnotation
{
}
CODE_SAMPLE
)]);
}
/**
* @return array<class-string<Node>>
*/
public function getNodeTypes() : array
{
return [\PhpParser\Node\Stmt\Class_::class];
}
/**
* @param Class_ $node
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($node);
if (!$phpDocInfo instanceof \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo) {
return null;
}
if (!$phpDocInfo->hasByNames(['Annotation', 'annotation'])) {
return null;
}
$this->phpDocTagRemover->removeByName($phpDocInfo, 'annotation');
$this->phpDocTagRemover->removeByName($phpDocInfo, 'Annotation');
$attributeGroup = $this->phpAttributeGroupFactory->createFromClass('Attribute');
$this->decorateTarget($phpDocInfo, $attributeGroup);
foreach ($node->getProperties() as $property) {
$propertyPhpDocInfo = $this->phpDocInfoFactory->createFromNode($property);
if (!$propertyPhpDocInfo instanceof \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo) {
continue;
}
$requiredDoctrineAnnotationTagValueNode = $propertyPhpDocInfo->getByAnnotationClass('Doctrine\\Common\\Annotations\\Annotation\\Required');
if (!$requiredDoctrineAnnotationTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
continue;
}
$this->phpDocTagRemover->removeTagValueFromNode($propertyPhpDocInfo, $requiredDoctrineAnnotationTagValueNode);
// require in constructor
$propertyName = $this->getName($property);
$this->addConstructorDependencyToClass($node, new \PHPStan\Type\MixedType(), $propertyName, \PhpParser\Node\Stmt\Class_::MODIFIER_PUBLIC);
$this->removeNode($property);
}
$node->attrGroups[] = $attributeGroup;
return $node;
}
/**
* @param array<string, mixed> $targetValues
* @return ClassConstFetch[]
*/
private function resolveFlags(array $targetValues) : array
{
$flags = [];
foreach (self::TARGET_TO_CONSTANT_MAP as $target => $constant) {
if (!\in_array($target, $targetValues, \true)) {
continue;
}
$flags[] = $this->nodeFactory->createClassConstFetch('Attribute', $constant);
}
return $flags;
}
/**
* @param ClassConstFetch[] $flags
* @return ClassConstFetch|BitwiseOr|null
*/
private function createFlagCollection(array $flags) : ?\PhpParser\Node\Expr
{
if ($flags === []) {
return null;
}
$flagCollection = \array_shift($flags);
foreach ($flags as $flag) {
$flagCollection = new \PhpParser\Node\Expr\BinaryOp\BitwiseOr($flagCollection, $flag);
}
return $flagCollection;
}
private function decorateTarget(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo, \PhpParser\Node\AttributeGroup $attributeGroup) : void
{
$targetDoctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass('Doctrine\\Common\\Annotations\\Annotation\\Target');
if (!$targetDoctrineAnnotationTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
return;
}
$this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $targetDoctrineAnnotationTagValueNode);
$targets = $targetDoctrineAnnotationTagValueNode->getSilentValue();
if (!$targets instanceof \Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode) {
return;
}
$targetValues = $targets->getValuesWithExplicitSilentAndWithoutQuotes();
$flags = $this->resolveFlags($targetValues);
$flagCollection = $this->createFlagCollection($flags);
if ($flagCollection === null) {
return;
}
$attributeGroup->attrs[0]->args[] = new \PhpParser\Node\Arg($flagCollection);
}
}

View File

@ -11,7 +11,6 @@ use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Property;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\PhpParser\Comparing\NodeComparator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\PhpParser\NodeFinder\PropertyFetchFinder;

View File

@ -15,6 +15,7 @@ use Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation;
use RectorPrefix20210520\Symplify\Astral\ValueObject\NodeBuilder\UseBuilder;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Restoration\Rector\Namespace_\CompleteImportForPartialAnnotationRector\CompleteImportForPartialAnnotationRectorTest
*/
@ -79,12 +80,14 @@ CODE_SAMPLE
return $node;
}
/**
* @param CompleteImportForPartialAnnotation[][] $configuration
* @param array<string, CompleteImportForPartialAnnotation[]> $configuration
*/
public function configure(array $configuration) : void
{
$useImportsToRestore = $configuration[self::USE_IMPORTS_TO_RESTORE] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($useImportsToRestore, \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation::class);
$default = [new \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation('Doctrine\\ORM\\Mapping', 'ORM'), new \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation('Symfony\\Component\\Validator\\Constraints', 'Assert'), new \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation('JMS\\Serializer\\Annotation', 'Serializer')];
$this->useImportsToRestore = \array_merge($configuration[self::USE_IMPORTS_TO_RESTORE] ?? [], $default);
$this->useImportsToRestore = \array_merge($useImportsToRestore, $default);
}
private function addImportToNamespaceIfMissing(\PhpParser\Node\Stmt\Namespace_ $namespace, \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation $completeImportForPartialAnnotation) : \PhpParser\Node\Stmt\Namespace_
{

View File

@ -10,6 +10,7 @@ use Rector\Core\Rector\AbstractRector;
use Rector\Transform\ValueObject\ReplaceParentCallByPropertyCall;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix20210520\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Transform\Rector\MethodCall\ReplaceParentCallByPropertyCallRector\ReplaceParentCallByPropertyCallRectorTest
*/
@ -74,6 +75,8 @@ CODE_SAMPLE
*/
public function configure(array $configuration) : void
{
$this->parentCallToProperties = $configuration[self::PARENT_CALLS_TO_PROPERTIES] ?? [];
$parentCallToProperties = $configuration[self::PARENT_CALLS_TO_PROPERTIES] ?? [];
\RectorPrefix20210520\Webmozart\Assert\Assert::allIsInstanceOf($parentCallToProperties, \Rector\Transform\ValueObject\ReplaceParentCallByPropertyCall::class);
$this->parentCallToProperties = $parentCallToProperties;
}
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '0b9c95e8d60629a0ec962f37645443b4c77d3140';
public const PACKAGE_VERSION = 'e5390727136d914b273b04ec8f5b6b0414f28b6a';
/**
* @var string
*/
public const RELEASE_DATE = '2021-05-20 22:10:58';
public const RELEASE_DATE = '2021-05-20 22:52:07';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210520\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit77531de8da2a941666762825948cc37d::getLoader();
return ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa::getLoader();

View File

@ -2726,6 +2726,7 @@ return array(
'Rector\\Php80\\Rector\\ClassMethod\\SetStateToStaticRector' => $baseDir . '/rules/Php80/Rector/ClassMethod/SetStateToStaticRector.php',
'Rector\\Php80\\Rector\\Class_\\AnnotationToAttributeRector' => $baseDir . '/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php',
'Rector\\Php80\\Rector\\Class_\\ClassPropertyAssignToConstructorPromotionRector' => $baseDir . '/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php',
'Rector\\Php80\\Rector\\Class_\\DoctrineAnnotationClassToAttributeRector' => $baseDir . '/rules/Php80/Rector/Class_/DoctrineAnnotationClassToAttributeRector.php',
'Rector\\Php80\\Rector\\Class_\\StringableForToStringRector' => $baseDir . '/rules/Php80/Rector/Class_/StringableForToStringRector.php',
'Rector\\Php80\\Rector\\FuncCall\\ClassOnObjectRector' => $baseDir . '/rules/Php80/Rector/FuncCall/ClassOnObjectRector.php',
'Rector\\Php80\\Rector\\FuncCall\\TokenGetAllToObjectRector' => $baseDir . '/rules/Php80/Rector/FuncCall/TokenGetAllToObjectRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit77531de8da2a941666762825948cc37d
class ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit77531de8da2a941666762825948cc37d
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit77531de8da2a941666762825948cc37d', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit77531de8da2a941666762825948cc37d', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit77531de8da2a941666762825948cc37d::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit0561d87fa037fb5ebda50a20250b49fa::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit77531de8da2a941666762825948cc37d
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit77531de8da2a941666762825948cc37d::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit0561d87fa037fb5ebda50a20250b49fa::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire77531de8da2a941666762825948cc37d($fileIdentifier, $file);
composerRequire0561d87fa037fb5ebda50a20250b49fa($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire77531de8da2a941666762825948cc37d($fileIdentifier, $file)
function composerRequire0561d87fa037fb5ebda50a20250b49fa($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit77531de8da2a941666762825948cc37d
class ComposerStaticInit0561d87fa037fb5ebda50a20250b49fa
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3075,6 +3075,7 @@ class ComposerStaticInit77531de8da2a941666762825948cc37d
'Rector\\Php80\\Rector\\ClassMethod\\SetStateToStaticRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/ClassMethod/SetStateToStaticRector.php',
'Rector\\Php80\\Rector\\Class_\\AnnotationToAttributeRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php',
'Rector\\Php80\\Rector\\Class_\\ClassPropertyAssignToConstructorPromotionRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php',
'Rector\\Php80\\Rector\\Class_\\DoctrineAnnotationClassToAttributeRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/Class_/DoctrineAnnotationClassToAttributeRector.php',
'Rector\\Php80\\Rector\\Class_\\StringableForToStringRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/Class_/StringableForToStringRector.php',
'Rector\\Php80\\Rector\\FuncCall\\ClassOnObjectRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/FuncCall/ClassOnObjectRector.php',
'Rector\\Php80\\Rector\\FuncCall\\TokenGetAllToObjectRector' => __DIR__ . '/../..' . '/rules/Php80/Rector/FuncCall/TokenGetAllToObjectRector.php',
@ -3812,9 +3813,9 @@ class ComposerStaticInit77531de8da2a941666762825948cc37d
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit77531de8da2a941666762825948cc37d::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit77531de8da2a941666762825948cc37d::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit77531de8da2a941666762825948cc37d::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit0561d87fa037fb5ebda50a20250b49fa::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0561d87fa037fb5ebda50a20250b49fa::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0561d87fa037fb5ebda50a20250b49fa::$classMap;
}, null, ClassLoader::class);
}

View File

@ -21,8 +21,8 @@ if (!class_exists('SomeTestCase', false) && !interface_exists('SomeTestCase', fa
if (!class_exists('CheckoutEntityFactory', false) && !interface_exists('CheckoutEntityFactory', false) && !trait_exists('CheckoutEntityFactory', false)) {
spl_autoload_call('RectorPrefix20210520\CheckoutEntityFactory');
}
if (!class_exists('ComposerAutoloaderInit77531de8da2a941666762825948cc37d', false) && !interface_exists('ComposerAutoloaderInit77531de8da2a941666762825948cc37d', false) && !trait_exists('ComposerAutoloaderInit77531de8da2a941666762825948cc37d', false)) {
spl_autoload_call('RectorPrefix20210520\ComposerAutoloaderInit77531de8da2a941666762825948cc37d');
if (!class_exists('ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa', false) && !interface_exists('ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa', false) && !trait_exists('ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa', false)) {
spl_autoload_call('RectorPrefix20210520\ComposerAutoloaderInit0561d87fa037fb5ebda50a20250b49fa');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210520\Doctrine\Inflector\Inflector');
@ -92,9 +92,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210520\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire77531de8da2a941666762825948cc37d')) {
function composerRequire77531de8da2a941666762825948cc37d() {
return \RectorPrefix20210520\composerRequire77531de8da2a941666762825948cc37d(...func_get_args());
if (!function_exists('composerRequire0561d87fa037fb5ebda50a20250b49fa')) {
function composerRequire0561d87fa037fb5ebda50a20250b49fa() {
return \RectorPrefix20210520\composerRequire0561d87fa037fb5ebda50a20250b49fa(...func_get_args());
}
}
if (!function_exists('parseArgs')) {