Updated Rector to commit d4c5ec6dfa

d4c5ec6dfa [Feature] Add VarAnnotationIncorrectNullableRector for fixing incorrect null type in @var (#2053)
This commit is contained in:
Tomas Votruba 2022-04-11 13:09:08 +00:00
parent 2afd97948d
commit cf05c72543
10 changed files with 324 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# 507 Rules Overview
# 508 Rules Overview
<br>
@ -88,7 +88,7 @@
- [Transform](#transform) (35)
- [TypeDeclaration](#typedeclaration) (23)
- [TypeDeclaration](#typedeclaration) (24)
- [Visibility](#visibility) (3)
@ -11871,6 +11871,25 @@ Complete property type based on getter strict types
<br>
### VarAnnotationIncorrectNullableRector
Add or remove null type from `@var` phpdoc typehint based on php property type declaration
- class: [`Rector\TypeDeclaration\Rector\Property\VarAnnotationIncorrectNullableRector`](../rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php)
```diff
final class SomeClass
{
/**
- * @var DateTime[]
+ * @var DateTime[]|null
*/
private ?array $dateTimes;
}
```
<br>
## Visibility
### ChangeConstantVisibilityRector

View File

@ -0,0 +1,55 @@
<?php
declare (strict_types=1);
namespace Rector\TypeDeclaration\Guard;
use RectorPrefix20220411\Nette\Utils\Strings;
use PhpParser\Comment\Doc;
use PhpParser\Node\Stmt\Property;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\NodeTypeResolver\Node\AttributeKey;
final class PhpDocNestedAnnotationGuard
{
/**
* Regex is used to count annotations including nested annotations
*
* @see https://regex101.com/r/G7wODT/1
* @var string
*/
private const SIMPLE_ANNOTATION_REGEX = '/@[A-z]+\\(?/i';
/**
* @readonly
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
*/
private $phpDocInfoFactory;
public function __construct(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory $phpDocInfoFactory)
{
$this->phpDocInfoFactory = $phpDocInfoFactory;
}
/**
* Check if rector accidentally skipped annotation during parsing which it should not have (this bug is likely related to parsing of annotations
* in phpstan / rector)
*/
public function isPhpDocCommentCorrectlyParsed(\PhpParser\Node\Stmt\Property $property) : bool
{
$comments = $property->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::COMMENTS, []);
if ((\is_array($comments) || $comments instanceof \Countable ? \count($comments) : 0) !== 1) {
return \true;
}
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
/** @var Doc $phpDoc */
$phpDoc = $comments[0];
$originalPhpDocText = $phpDoc->getText();
/**
* This is a safeguard to skip cases where the PhpStan / Rector phpdoc parser parses annotations incorrectly (ie.: nested annotations)
*/
$parsedPhpDocText = (string) $phpDocInfo->getPhpDocNode();
return !$this->hasAnnotationCountChanged($originalPhpDocText, $parsedPhpDocText);
}
public function hasAnnotationCountChanged(string $originalPhpDocText, string $updatedPhpDocText) : bool
{
$originalAnnotationCount = \count(\RectorPrefix20220411\Nette\Utils\Strings::matchAll($originalPhpDocText, self::SIMPLE_ANNOTATION_REGEX));
$reconstructedAnnotationCount = \count(\RectorPrefix20220411\Nette\Utils\Strings::matchAll($updatedPhpDocText, self::SIMPLE_ANNOTATION_REGEX));
return $originalAnnotationCount !== $reconstructedAnnotationCount;
}
}

View File

@ -0,0 +1,99 @@
<?php
declare (strict_types=1);
namespace Rector\TypeDeclaration\Helper;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Param;
use PHPStan\Type\NullType;
use PHPStan\Type\Type;
use PHPStan\Type\TypeCombinator;
use PHPStan\Type\UnionType;
use Rector\Core\PhpParser\Node\Value\ValueResolver;
use Rector\StaticTypeMapper\StaticTypeMapper;
final class PhpDocNullableTypeHelper
{
/**
* @readonly
* @var \Rector\StaticTypeMapper\StaticTypeMapper
*/
private $staticTypeMapper;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\Value\ValueResolver
*/
private $valueResolver;
public function __construct(\Rector\StaticTypeMapper\StaticTypeMapper $staticTypeMapper, \Rector\Core\PhpParser\Node\Value\ValueResolver $valueResolver)
{
$this->staticTypeMapper = $staticTypeMapper;
$this->valueResolver = $valueResolver;
}
/**
* @return Type|null Returns null if it was not possible to resolve new php doc type or if update is not required
*/
public function resolveUpdatedPhpDocTypeFromPhpDocTypeAndPhpParserType(\PHPStan\Type\Type $phpDocType, \PHPStan\Type\Type $phpParserType) : ?\PHPStan\Type\Type
{
return $this->resolveUpdatedPhpDocTypeFromPhpDocTypeAndPhpParserTypeNullInfo($phpDocType, $this->isParserTypeContainingNullType($phpParserType));
}
/**
* @return Type|null Returns null if it was not possible to resolve new php doc param type or if update is not required
*/
public function resolveUpdatedPhpDocTypeFromPhpDocTypeAndParamNode(\PHPStan\Type\Type $phpDocType, \PhpParser\Node\Param $param) : ?\PHPStan\Type\Type
{
if ($param->type === null) {
return null;
}
$phpParserType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
if ($phpParserType instanceof \PHPStan\Type\UnionType) {
$isPhpParserTypeContainingNullType = \PHPStan\Type\TypeCombinator::containsNull($phpParserType);
} elseif ($param->default !== null) {
$value = $this->valueResolver->getValue($param->default);
$isPhpParserTypeContainingNullType = $value === null || $param->default instanceof \PhpParser\Node\Expr\ConstFetch && $value === 'null';
} else {
$isPhpParserTypeContainingNullType = \false;
}
return $this->resolveUpdatedPhpDocTypeFromPhpDocTypeAndPhpParserTypeNullInfo($phpDocType, $isPhpParserTypeContainingNullType);
}
private function isItRequiredToRemoveOrAddNullTypeToUnion(bool $phpDocTypeContainsNullType, bool $phpParserTypeContainsNullType) : bool
{
return $phpParserTypeContainsNullType && !$phpDocTypeContainsNullType || !$phpParserTypeContainsNullType && $phpDocTypeContainsNullType;
}
/**
* @param Type[] $updatedDocTypes
*/
private function composeUpdatedPhpDocType(array $updatedDocTypes) : \PHPStan\Type\Type
{
return \count($updatedDocTypes) === 1 ? $updatedDocTypes[0] : new \PHPStan\Type\UnionType($updatedDocTypes);
}
private function isParserTypeContainingNullType(\PHPStan\Type\Type $phpParserType) : bool
{
if ($phpParserType instanceof \PHPStan\Type\UnionType) {
return \PHPStan\Type\TypeCombinator::containsNull($phpParserType);
}
return \false;
}
private function resolveUpdatedPhpDocTypeFromPhpDocTypeAndPhpParserTypeNullInfo(\PHPStan\Type\Type $phpDocType, bool $isPhpParserTypeContainingNullType) : ?\PHPStan\Type\Type
{
/** @var array<(NullType | UnionType)> $updatedDocTypes */
$updatedDocTypes = [];
$phpDocTypeContainsNullType = \false;
if ($phpDocType instanceof \PHPStan\Type\UnionType) {
$phpDocTypeContainsNullType = \PHPStan\Type\TypeCombinator::containsNull($phpDocType);
foreach ($phpDocType->getTypes() as $subType) {
if ($subType instanceof \PHPStan\Type\NullType) {
continue;
}
$updatedDocTypes[] = $subType;
}
} else {
$updatedDocTypes[] = $phpDocType;
}
if (!$this->isItRequiredToRemoveOrAddNullTypeToUnion($phpDocTypeContainsNullType, $isPhpParserTypeContainingNullType)) {
return null;
}
if ($isPhpParserTypeContainingNullType) {
$updatedDocTypes[] = new \PHPStan\Type\NullType();
}
return $this->composeUpdatedPhpDocType($updatedDocTypes);
}
}

View File

@ -0,0 +1,124 @@
<?php
declare (strict_types=1);
namespace Rector\TypeDeclaration\Rector\Property;
use PhpParser\Node;
use PhpParser\Node\Stmt\Property;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use PHPStan\Type\MixedType;
use PHPStan\Type\Type;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\TypeDeclaration\Guard\PhpDocNestedAnnotationGuard;
use Rector\TypeDeclaration\Helper\PhpDocNullableTypeHelper;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\TypeDeclaration\Rector\Property\VarAnnotationIncorrectNullableRector\VarAnnotationIncorrectNullableRectorTest
*/
final class VarAnnotationIncorrectNullableRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @readonly
* @var \Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger
*/
private $phpDocTypeChanger;
/**
* @readonly
* @var \Rector\TypeDeclaration\Helper\PhpDocNullableTypeHelper
*/
private $phpDocNullableTypeHelper;
/**
* @readonly
* @var \Rector\TypeDeclaration\Guard\PhpDocNestedAnnotationGuard
*/
private $phpDocNestedAnnotationGuard;
public function __construct(\Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger $phpDocTypeChanger, \Rector\TypeDeclaration\Helper\PhpDocNullableTypeHelper $phpDocNullableTypeHelper, \Rector\TypeDeclaration\Guard\PhpDocNestedAnnotationGuard $phpDocNestedAnnotationGuard)
{
$this->phpDocTypeChanger = $phpDocTypeChanger;
$this->phpDocNullableTypeHelper = $phpDocNullableTypeHelper;
$this->phpDocNestedAnnotationGuard = $phpDocNestedAnnotationGuard;
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Add or remove null type from @var phpdoc typehint based on php property type declaration', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
final class SomeClass
{
/**
* @var DateTime[]
*/
private ?array $dateTimes;
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
final class SomeClass
{
/**
* @var DateTime[]|null
*/
private ?array $dateTimes;
}
CODE_SAMPLE
)]);
}
/**
* @return array<class-string<Node>>
*/
public function getNodeTypes() : array
{
return [\PhpParser\Node\Stmt\Property::class];
}
/**
* @param Property $node
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
if (\count($node->props) !== 1) {
return null;
}
if (!$this->phpVersionProvider->isAtLeastPhpVersion(\Rector\Core\ValueObject\PhpVersionFeature::TYPED_PROPERTIES)) {
return null;
}
if (!$this->phpDocNestedAnnotationGuard->isPhpDocCommentCorrectlyParsed($node)) {
return null;
}
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);
if (!$this->isVarDocAlreadySet($phpDocInfo)) {
return null;
}
if ($node->type === null) {
return null;
}
$phpParserType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($node->type);
$varTagValueNode = $phpDocInfo->getVarTagValueNode();
if (!$varTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode) {
return null;
}
if ($varTagValueNode->type === null) {
return null;
}
$docType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($varTagValueNode->type, $node);
$updatedPhpDocType = $this->phpDocNullableTypeHelper->resolveUpdatedPhpDocTypeFromPhpDocTypeAndPhpParserType($docType, $phpParserType);
if (!$updatedPhpDocType instanceof \PHPStan\Type\Type) {
return null;
}
$this->phpDocTypeChanger->changeVarType($phpDocInfo, $updatedPhpDocType);
if (!$phpDocInfo->hasChanged()) {
return null;
}
return $node;
}
private function isVarDocAlreadySet(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo $phpDocInfo) : bool
{
foreach (['@var', '@phpstan-var', '@psalm-var'] as $tagName) {
$varType = $phpDocInfo->getVarType($tagName);
if (!$varType instanceof \PHPStan\Type\MixedType) {
return \true;
}
}
return \false;
}
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '20a5be338e14d5bfe3df0fb9ba6c8138882bf607';
public const PACKAGE_VERSION = 'd4c5ec6dfae1c9d56555b17ef54134555e3f4294';
/**
* @var string
*/
public const RELEASE_DATE = '2022-04-11 13:23:20';
public const RELEASE_DATE = '2022-04-11 15:02:33';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220411\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

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

View File

@ -3081,7 +3081,9 @@ return array(
'Rector\\TypeDeclaration\\Contract\\TypeInferer\\ReturnTypeInfererInterface' => $baseDir . '/rules/TypeDeclaration/Contract/TypeInferer/ReturnTypeInfererInterface.php',
'Rector\\TypeDeclaration\\Exception\\ConflictingPriorityException' => $baseDir . '/rules/TypeDeclaration/Exception/ConflictingPriorityException.php',
'Rector\\TypeDeclaration\\FunctionLikeReturnTypeResolver' => $baseDir . '/rules/TypeDeclaration/FunctionLikeReturnTypeResolver.php',
'Rector\\TypeDeclaration\\Guard\\PhpDocNestedAnnotationGuard' => $baseDir . '/rules/TypeDeclaration/Guard/PhpDocNestedAnnotationGuard.php',
'Rector\\TypeDeclaration\\Guard\\PropertyTypeOverrideGuard' => $baseDir . '/rules/TypeDeclaration/Guard/PropertyTypeOverrideGuard.php',
'Rector\\TypeDeclaration\\Helper\\PhpDocNullableTypeHelper' => $baseDir . '/rules/TypeDeclaration/Helper/PhpDocNullableTypeHelper.php',
'Rector\\TypeDeclaration\\Matcher\\PropertyAssignMatcher' => $baseDir . '/rules/TypeDeclaration/Matcher/PropertyAssignMatcher.php',
'Rector\\TypeDeclaration\\NodeAnalyzer\\AutowiredClassMethodOrPropertyAnalyzer' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/AutowiredClassMethodOrPropertyAnalyzer.php',
'Rector\\TypeDeclaration\\NodeAnalyzer\\CallTypesResolver' => $baseDir . '/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php',
@ -3122,6 +3124,7 @@ return array(
'Rector\\TypeDeclaration\\Rector\\Property\\TypedPropertyFromAssignsRector' => $baseDir . '/rules/TypeDeclaration/Rector/Property/TypedPropertyFromAssignsRector.php',
'Rector\\TypeDeclaration\\Rector\\Property\\TypedPropertyFromStrictConstructorRector' => $baseDir . '/rules/TypeDeclaration/Rector/Property/TypedPropertyFromStrictConstructorRector.php',
'Rector\\TypeDeclaration\\Rector\\Property\\TypedPropertyFromStrictGetterMethodReturnTypeRector' => $baseDir . '/rules/TypeDeclaration/Rector/Property/TypedPropertyFromStrictGetterMethodReturnTypeRector.php',
'Rector\\TypeDeclaration\\Rector\\Property\\VarAnnotationIncorrectNullableRector' => $baseDir . '/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php',
'Rector\\TypeDeclaration\\Sorter\\PriorityAwareSorter' => $baseDir . '/rules/TypeDeclaration/Sorter/PriorityAwareSorter.php',
'Rector\\TypeDeclaration\\TypeAlreadyAddedChecker\\ReturnTypeAlreadyAddedChecker' => $baseDir . '/rules/TypeDeclaration/TypeAlreadyAddedChecker/ReturnTypeAlreadyAddedChecker.php',
'Rector\\TypeDeclaration\\TypeAnalyzer\\AdvancedArrayAnalyzer' => $baseDir . '/rules/TypeDeclaration/TypeAnalyzer/AdvancedArrayAnalyzer.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb
class ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitaa8ed53f16a77f2106a0a22262db4438::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInitaa8ed53f16a77f2106a0a22262db4438::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire156ea5388f1439fc65a15f12dc64c7cb($fileIdentifier, $file);
composerRequireaa8ed53f16a77f2106a0a22262db4438($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb
* @param string $file
* @return void
*/
function composerRequire156ea5388f1439fc65a15f12dc64c7cb($fileIdentifier, $file)
function composerRequireaa8ed53f16a77f2106a0a22262db4438($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 ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb
class ComposerStaticInitaa8ed53f16a77f2106a0a22262db4438
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3450,7 +3450,9 @@ class ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb
'Rector\\TypeDeclaration\\Contract\\TypeInferer\\ReturnTypeInfererInterface' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Contract/TypeInferer/ReturnTypeInfererInterface.php',
'Rector\\TypeDeclaration\\Exception\\ConflictingPriorityException' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Exception/ConflictingPriorityException.php',
'Rector\\TypeDeclaration\\FunctionLikeReturnTypeResolver' => __DIR__ . '/../..' . '/rules/TypeDeclaration/FunctionLikeReturnTypeResolver.php',
'Rector\\TypeDeclaration\\Guard\\PhpDocNestedAnnotationGuard' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Guard/PhpDocNestedAnnotationGuard.php',
'Rector\\TypeDeclaration\\Guard\\PropertyTypeOverrideGuard' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Guard/PropertyTypeOverrideGuard.php',
'Rector\\TypeDeclaration\\Helper\\PhpDocNullableTypeHelper' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Helper/PhpDocNullableTypeHelper.php',
'Rector\\TypeDeclaration\\Matcher\\PropertyAssignMatcher' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Matcher/PropertyAssignMatcher.php',
'Rector\\TypeDeclaration\\NodeAnalyzer\\AutowiredClassMethodOrPropertyAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/AutowiredClassMethodOrPropertyAnalyzer.php',
'Rector\\TypeDeclaration\\NodeAnalyzer\\CallTypesResolver' => __DIR__ . '/../..' . '/rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php',
@ -3491,6 +3493,7 @@ class ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb
'Rector\\TypeDeclaration\\Rector\\Property\\TypedPropertyFromAssignsRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Property/TypedPropertyFromAssignsRector.php',
'Rector\\TypeDeclaration\\Rector\\Property\\TypedPropertyFromStrictConstructorRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Property/TypedPropertyFromStrictConstructorRector.php',
'Rector\\TypeDeclaration\\Rector\\Property\\TypedPropertyFromStrictGetterMethodReturnTypeRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Property/TypedPropertyFromStrictGetterMethodReturnTypeRector.php',
'Rector\\TypeDeclaration\\Rector\\Property\\VarAnnotationIncorrectNullableRector' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Rector/Property/VarAnnotationIncorrectNullableRector.php',
'Rector\\TypeDeclaration\\Sorter\\PriorityAwareSorter' => __DIR__ . '/../..' . '/rules/TypeDeclaration/Sorter/PriorityAwareSorter.php',
'Rector\\TypeDeclaration\\TypeAlreadyAddedChecker\\ReturnTypeAlreadyAddedChecker' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAlreadyAddedChecker/ReturnTypeAlreadyAddedChecker.php',
'Rector\\TypeDeclaration\\TypeAnalyzer\\AdvancedArrayAnalyzer' => __DIR__ . '/../..' . '/rules/TypeDeclaration/TypeAnalyzer/AdvancedArrayAnalyzer.php',
@ -3856,9 +3859,9 @@ class ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit156ea5388f1439fc65a15f12dc64c7cb::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitaa8ed53f16a77f2106a0a22262db4438::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaa8ed53f16a77f2106a0a22262db4438::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitaa8ed53f16a77f2106a0a22262db4438::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220411\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb', false) && !interface_exists('ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb', false) && !trait_exists('ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb', false)) {
spl_autoload_call('RectorPrefix20220411\ComposerAutoloaderInit156ea5388f1439fc65a15f12dc64c7cb');
if (!class_exists('ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438', false) && !interface_exists('ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438', false) && !trait_exists('ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438', false)) {
spl_autoload_call('RectorPrefix20220411\ComposerAutoloaderInitaa8ed53f16a77f2106a0a22262db4438');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220411\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220411\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire156ea5388f1439fc65a15f12dc64c7cb')) {
function composerRequire156ea5388f1439fc65a15f12dc64c7cb() {
return \RectorPrefix20220411\composerRequire156ea5388f1439fc65a15f12dc64c7cb(...func_get_args());
if (!function_exists('composerRequireaa8ed53f16a77f2106a0a22262db4438')) {
function composerRequireaa8ed53f16a77f2106a0a22262db4438() {
return \RectorPrefix20220411\composerRequireaa8ed53f16a77f2106a0a22262db4438(...func_get_args());
}
}
if (!function_exists('scanPath')) {