Updated Rector to commit f7ba2752e3

f7ba2752e3 Cleanup (#438)
This commit is contained in:
Tomas Votruba 2021-07-15 10:36:02 +00:00
parent 8071bdbada
commit 65a21970aa
12 changed files with 111 additions and 307 deletions

View File

@ -4,14 +4,12 @@ declare (strict_types=1);
namespace RectorPrefix20210715;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQualityStrict\Rector\If_\MoveOutMethodCallInsideIfConditionRector;
use Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
$services = $containerConfigurator->services();
$services->set(\Rector\CodeQualityStrict\Rector\If_\MoveOutMethodCallInsideIfConditionRector::class);
$services->set(\Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector::class);
$services->set(\Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector::class);
$services->set(\Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector::class);

View File

@ -15,9 +15,11 @@ use Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateClassConstantRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveLastReturnRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
use Rector\DeadCode\Rector\Concat\RemoveConcatAutocastRector;
@ -94,4 +96,5 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector::class);
$services->set(\Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector::class);
$services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class);
$services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveLastReturnRector::class);
};

View File

@ -1,141 +0,0 @@
<?php
declare (strict_types=1);
namespace Rector\CodeQuality\Naming;
use RectorPrefix20210715\Nette\Utils\Strings;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Scalar\String_;
use Rector\Naming\Naming\ExpectedNameResolver;
use Rector\NodeNameResolver\NodeNameResolver;
final class MethodCallToVariableNameResolver
{
/**
* @var string
* @see https://regex101.com/r/LTykey/1
*/
private const START_ALPHA_REGEX = '#^[a-zA-Z]#';
/**
* @var string
* @see https://regex101.com/r/sYIKpj/1
*/
private const CONSTANT_REGEX = '#(_)([a-z])#';
/**
* @var string
* @see https://regex101.com/r/dhAgLI/1
*/
private const SPACE_REGEX = '#\\s+#';
/**
* @var string
* @see https://regex101.com/r/TOPfAQ/1
*/
private const VALID_STRING_VARIABLE_REGEX = '#^[a-z_]\\w*$#';
/**
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
/**
* @var \Rector\Naming\Naming\ExpectedNameResolver
*/
private $expectedNameResolver;
public function __construct(\Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Naming\Naming\ExpectedNameResolver $expectedNameResolver)
{
$this->nodeNameResolver = $nodeNameResolver;
$this->expectedNameResolver = $expectedNameResolver;
}
/**
* @todo decouple to collector by arg type
*/
public function resolveVariableName(\PhpParser\Node\Expr\MethodCall $methodCall) : ?string
{
$callerName = $this->nodeNameResolver->getName($methodCall->var);
$methodCallName = $this->nodeNameResolver->getName($methodCall->name);
if ($callerName === null) {
return null;
}
if ($methodCallName === null) {
return null;
}
$result = $this->getVariableName($methodCall, $callerName, $methodCallName);
if (!\RectorPrefix20210715\Nette\Utils\Strings::match($result, self::SPACE_REGEX)) {
return $result;
}
return $this->getFallbackVarName($callerName, $methodCallName);
}
private function getVariableName(\PhpParser\Node\Expr\MethodCall $methodCall, string $callerName, string $methodCallName) : string
{
$variableName = $this->expectedNameResolver->resolveForCall($methodCall);
if ($methodCall->args === [] && $variableName !== null && $variableName !== $callerName) {
return $variableName;
}
$fallbackVarName = $this->getFallbackVarName($callerName, $methodCallName);
$argValue = $methodCall->args[0]->value;
if ($argValue instanceof \PhpParser\Node\Expr\ClassConstFetch && $argValue->name instanceof \PhpParser\Node\Identifier) {
return $this->getClassConstFetchVarName($argValue, $methodCallName);
}
if ($argValue instanceof \PhpParser\Node\Scalar\String_) {
return $this->getStringVarName($argValue, $callerName, $fallbackVarName);
}
$argumentName = $this->nodeNameResolver->getName($argValue);
if (!$argValue instanceof \PhpParser\Node\Expr\Variable) {
return $fallbackVarName;
}
if ($argumentName === null) {
return $fallbackVarName;
}
if ($variableName === null) {
return $fallbackVarName;
}
return $argumentName . \ucfirst($variableName);
}
private function isNamespacedFunctionName(string $functionName) : bool
{
return \strpos($functionName, '\\') !== \false;
}
private function getFallbackVarName(string $callerName, string $methodCallName) : string
{
if ($this->isNamespacedFunctionName($callerName)) {
$callerName = \RectorPrefix20210715\Nette\Utils\Strings::after($callerName, '\\', -1);
}
return $callerName . \ucfirst($methodCallName);
}
private function getClassConstFetchVarName(\PhpParser\Node\Expr\ClassConstFetch $classConstFetch, string $methodCallName) : string
{
/** @var Identifier $name */
$name = $classConstFetch->name;
$argValueName = \strtolower($name->toString());
if ($argValueName !== 'class') {
return \RectorPrefix20210715\Nette\Utils\Strings::replace($argValueName, self::CONSTANT_REGEX, function ($matches) : string {
return \strtoupper($matches[2]);
});
}
if ($classConstFetch->class instanceof \PhpParser\Node\Name) {
return $this->normalizeStringVariableName($methodCallName) . $classConstFetch->class->getLast();
}
return $this->normalizeStringVariableName($methodCallName);
}
private function getStringVarName(\PhpParser\Node\Scalar\String_ $string, string $callerName, string $fallbackVarName) : string
{
$normalizeStringVariableName = $this->normalizeStringVariableName($string->value . \ucfirst($fallbackVarName));
if (!\RectorPrefix20210715\Nette\Utils\Strings::match($normalizeStringVariableName, self::START_ALPHA_REGEX)) {
return $fallbackVarName;
}
if ($normalizeStringVariableName === $callerName) {
return $fallbackVarName;
}
return $normalizeStringVariableName;
}
private function normalizeStringVariableName(string $string) : string
{
if (!\RectorPrefix20210715\Nette\Utils\Strings::match($string, self::VALID_STRING_VARIABLE_REGEX)) {
return '';
}
$get = \str_ireplace('get', '', $string);
$by = \str_ireplace('by', '', $get);
return \str_replace('-', '', $by);
}
}

View File

@ -1,139 +0,0 @@
<?php
declare (strict_types=1);
namespace Rector\CodeQualityStrict\Rector\If_;
use PhpParser\Node;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Param;
use PhpParser\Node\Stmt\If_;
use PHPStan\Analyser\Scope;
use PHPStan\Type\BooleanType;
use PHPStan\Type\ThisType;
use Rector\CodeQuality\Naming\MethodCallToVariableNameResolver;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\CodeQualityStrict\Rector\If_\MoveOutMethodCallInsideIfConditionRector\MoveOutMethodCallInsideIfConditionRectorTest
*/
final class MoveOutMethodCallInsideIfConditionRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @var \Rector\CodeQuality\Naming\MethodCallToVariableNameResolver
*/
private $methodCallToVariableNameResolver;
public function __construct(\Rector\CodeQuality\Naming\MethodCallToVariableNameResolver $methodCallToVariableNameResolver)
{
$this->methodCallToVariableNameResolver = $methodCallToVariableNameResolver;
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Move out method call inside If condition', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
if ($obj->run($arg) === 1) {
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
$objRun = $obj->run($arg);
if ($objRun === 1) {
}
CODE_SAMPLE
)]);
}
/**
* @return array<class-string<Node>>
*/
public function getNodeTypes() : array
{
return [\PhpParser\Node\Stmt\If_::class];
}
/**
* @param If_ $node
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
/** @var MethodCall[] $methodCalls */
$methodCalls = $this->betterNodeFinder->findInstanceOf($node->cond, \PhpParser\Node\Expr\MethodCall::class);
$countMethodCalls = \count($methodCalls);
// No method call or Multiple method calls inside if → skip
if ($countMethodCalls !== 1) {
return null;
}
$methodCall = $methodCalls[0];
if ($this->shouldSkipMethodCall($methodCall)) {
return null;
}
return $this->moveOutMethodCall($methodCall, $node);
}
private function shouldSkipMethodCall(\PhpParser\Node\Expr\MethodCall $methodCall) : bool
{
$variableType = $this->getStaticType($methodCall->var);
// From PropertyFetch → skip
if ($variableType instanceof \PHPStan\Type\ThisType) {
return \true;
}
$methodCallReturnType = $this->getStaticType($methodCall);
if ($methodCallReturnType instanceof \PHPStan\Type\BooleanType) {
return \true;
}
// No Args → skip
if ($methodCall->args === []) {
return \true;
}
// Inside Method calls args has Method Call again → skip
return $this->isInsideMethodCallHasMethodCall($methodCall);
}
private function moveOutMethodCall(\PhpParser\Node\Expr\MethodCall $methodCall, \PhpParser\Node\Stmt\If_ $if) : ?\PhpParser\Node\Stmt\If_
{
$hasParentAssign = (bool) $this->betterNodeFinder->findParentType($methodCall, \PhpParser\Node\Expr\Assign::class);
if ($hasParentAssign) {
return null;
}
$variableName = $this->methodCallToVariableNameResolver->resolveVariableName($methodCall);
if ($variableName === null) {
return null;
}
if ($this->isVariableNameAlreadyDefined($if, $variableName)) {
return null;
}
$variable = new \PhpParser\Node\Expr\Variable($variableName);
$methodCallAssign = new \PhpParser\Node\Expr\Assign($variable, $methodCall);
$this->addNodebeforeNode($methodCallAssign, $if);
// replace if cond with variable
if ($if->cond === $methodCall) {
$if->cond = $variable;
return $if;
}
// replace method call with variable
$this->traverseNodesWithCallable($if->cond, function (\PhpParser\Node $node) use($variable) : ?Variable {
if ($node instanceof \PhpParser\Node\Expr\MethodCall) {
return $variable;
}
return null;
});
return $if;
}
private function isInsideMethodCallHasMethodCall(\PhpParser\Node\Expr\MethodCall $methodCall) : bool
{
foreach ($methodCall->args as $arg) {
if ($arg->value instanceof \PhpParser\Node\Expr\MethodCall) {
return \true;
}
}
return \false;
}
private function isVariableNameAlreadyDefined(\PhpParser\Node\Stmt\If_ $if, string $variableName) : bool
{
$scope = $if->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if (!$scope instanceof \PHPStan\Analyser\Scope) {
return \false;
}
return $scope->hasVariableType($variableName)->yes();
}
}

View File

@ -0,0 +1,83 @@
<?php
declare (strict_types=1);
namespace Rector\DeadCode\Rector\ClassMethod;
use PhpParser\Node;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\Return_;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\DeadCode\Rector\ClassMethod\RemoveLastReturnRector\RemoveLastReturnRectorTest
*/
final class RemoveLastReturnRector extends \Rector\Core\Rector\AbstractRector
{
/**
* @var \Rector\NodeNestingScope\ContextAnalyzer
*/
private $contextAnalyzer;
public function __construct(\Rector\NodeNestingScope\ContextAnalyzer $contextAnalyzer)
{
$this->contextAnalyzer = $contextAnalyzer;
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Remove very last `return` that has no meaning', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
function some_function($value)
{
if ($value === 1000) {
return;
}
if ($value) {
return;
}
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
function some_function($value)
{
if ($value === 1000) {
return;
}
if ($value) {
}
}
CODE_SAMPLE
)]);
}
/**
* @return array<class-string<\PhpParser\Node>>
*/
public function getNodeTypes() : array
{
return [\PhpParser\Node\Stmt\ClassMethod::class, \PhpParser\Node\Stmt\Function_::class];
}
/**
* @param ClassMethod|Function_ $node
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
// last node and last return
$lastNode = $this->betterNodeFinder->findLastInstanceOf((array) $node->stmts, \PhpParser\Node::class);
$lastReturn = $this->betterNodeFinder->findLastInstanceOf((array) $node->stmts, \PhpParser\Node\Stmt\Return_::class);
if (!$lastReturn instanceof \PhpParser\Node\Stmt\Return_) {
return null;
}
if ($lastNode === null) {
return null;
}
if ($lastNode !== $lastReturn) {
return null;
}
if ($this->contextAnalyzer->isInLoop($lastReturn)) {
return null;
}
$this->removeNode($lastReturn);
return null;
}
}

View File

@ -22,7 +22,10 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
*/
final class IncreaseColumnIndexRector extends \Rector\Core\Rector\AbstractRector
{
public const ALREADY_CHANGED = 'already_changed';
/**
* @var string
*/
private const ALREADY_CHANGED = 'already_changed';
/**
* @var ObjectType[]
*/
@ -105,7 +108,6 @@ CODE_SAMPLE
}
if ($binaryOp->right instanceof \PhpParser\Node\Scalar\LNumber) {
++$binaryOp->right->value;
return;
}
}
private function findPreviousForWithVariable(\PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Scalar\LNumber

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'bb16912ba40dc3523ddf77ccb6a2d00df2c7fafd';
public const PACKAGE_VERSION = 'f7ba2752e3c9731621d9b81e535dc7d998c4aa1d';
/**
* @var string
*/
public const RELEASE_DATE = '2021-07-14 21:07:57';
public const RELEASE_DATE = '2021-07-15 01:07:54';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210715\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 ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe::getLoader();
return ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6::getLoader();

View File

@ -1598,11 +1598,9 @@ return array(
'Rector\\ChangesReporting\\ValueObjectFactory\\FileDiffFactory' => $baseDir . '/packages/ChangesReporting/ValueObjectFactory/FileDiffFactory.php',
'Rector\\ChangesReporting\\ValueObject\\RectorWithLineChange' => $baseDir . '/packages/ChangesReporting/ValueObject/RectorWithLineChange.php',
'Rector\\CodeQualityStrict\\NodeFactory\\ClassConstFetchFactory' => $baseDir . '/rules/CodeQualityStrict/NodeFactory/ClassConstFetchFactory.php',
'Rector\\CodeQualityStrict\\Rector\\If_\\MoveOutMethodCallInsideIfConditionRector' => $baseDir . '/rules/CodeQualityStrict/Rector/If_/MoveOutMethodCallInsideIfConditionRector.php',
'Rector\\CodeQualityStrict\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => $baseDir . '/rules/CodeQualityStrict/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
'Rector\\CodeQualityStrict\\TypeAnalyzer\\SubTypeAnalyzer' => $baseDir . '/rules/CodeQualityStrict/TypeAnalyzer/SubTypeAnalyzer.php',
'Rector\\CodeQuality\\CompactConverter' => $baseDir . '/rules/CodeQuality/CompactConverter.php',
'Rector\\CodeQuality\\Naming\\MethodCallToVariableNameResolver' => $baseDir . '/rules/CodeQuality/Naming/MethodCallToVariableNameResolver.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ArrayCompacter' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ArrayCompacter.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ArrayItemsAnalyzer' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ArrayItemsAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ClassLikeAnalyzer' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ClassLikeAnalyzer.php',
@ -1965,6 +1963,7 @@ return array(
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveDeadConstructorRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveDeadConstructorRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveDelegatingParentCallRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveDelegatingParentCallRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveEmptyClassMethodRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveEmptyClassMethodRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveLastReturnRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveLastReturnRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedConstructorParamRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedConstructorParamRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPrivateMethodParameterRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodParameterRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPrivateMethodRector' => $baseDir . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe
class ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6', '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\ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit2043d736b2ca689d52e4bedb374f5ad6::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit2043d736b2ca689d52e4bedb374f5ad6::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire0f5ffdaa51ee251b178165917f0550fe($fileIdentifier, $file);
composerRequire2043d736b2ca689d52e4bedb374f5ad6($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire0f5ffdaa51ee251b178165917f0550fe($fileIdentifier, $file)
function composerRequire2043d736b2ca689d52e4bedb374f5ad6($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe
class ComposerStaticInit2043d736b2ca689d52e4bedb374f5ad6
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -1953,11 +1953,9 @@ class ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe
'Rector\\ChangesReporting\\ValueObjectFactory\\FileDiffFactory' => __DIR__ . '/../..' . '/packages/ChangesReporting/ValueObjectFactory/FileDiffFactory.php',
'Rector\\ChangesReporting\\ValueObject\\RectorWithLineChange' => __DIR__ . '/../..' . '/packages/ChangesReporting/ValueObject/RectorWithLineChange.php',
'Rector\\CodeQualityStrict\\NodeFactory\\ClassConstFetchFactory' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/NodeFactory/ClassConstFetchFactory.php',
'Rector\\CodeQualityStrict\\Rector\\If_\\MoveOutMethodCallInsideIfConditionRector' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/Rector/If_/MoveOutMethodCallInsideIfConditionRector.php',
'Rector\\CodeQualityStrict\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
'Rector\\CodeQualityStrict\\TypeAnalyzer\\SubTypeAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQualityStrict/TypeAnalyzer/SubTypeAnalyzer.php',
'Rector\\CodeQuality\\CompactConverter' => __DIR__ . '/../..' . '/rules/CodeQuality/CompactConverter.php',
'Rector\\CodeQuality\\Naming\\MethodCallToVariableNameResolver' => __DIR__ . '/../..' . '/rules/CodeQuality/Naming/MethodCallToVariableNameResolver.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ArrayCompacter' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ArrayCompacter.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ArrayItemsAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ArrayItemsAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ClassLikeAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ClassLikeAnalyzer.php',
@ -2320,6 +2318,7 @@ class ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveDeadConstructorRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveDeadConstructorRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveDelegatingParentCallRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveDelegatingParentCallRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveEmptyClassMethodRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveEmptyClassMethodRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveLastReturnRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveLastReturnRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedConstructorParamRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedConstructorParamRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPrivateMethodParameterRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodParameterRector.php',
'Rector\\DeadCode\\Rector\\ClassMethod\\RemoveUnusedPrivateMethodRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php',
@ -3847,9 +3846,9 @@ class ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0f5ffdaa51ee251b178165917f0550fe::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit2043d736b2ca689d52e4bedb374f5ad6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit2043d736b2ca689d52e4bedb374f5ad6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit2043d736b2ca689d52e4bedb374f5ad6::$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('RectorPrefix20210715\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe', false) && !interface_exists('ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe', false) && !trait_exists('ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe', false)) {
spl_autoload_call('RectorPrefix20210715\ComposerAutoloaderInit0f5ffdaa51ee251b178165917f0550fe');
if (!class_exists('ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6', false) && !interface_exists('ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6', false) && !trait_exists('ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6', false)) {
spl_autoload_call('RectorPrefix20210715\ComposerAutoloaderInit2043d736b2ca689d52e4bedb374f5ad6');
}
if (!class_exists('Doctrine\Inflector\Inflector', false) && !interface_exists('Doctrine\Inflector\Inflector', false) && !trait_exists('Doctrine\Inflector\Inflector', false)) {
spl_autoload_call('RectorPrefix20210715\Doctrine\Inflector\Inflector');
@ -3308,9 +3308,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210715\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire0f5ffdaa51ee251b178165917f0550fe')) {
function composerRequire0f5ffdaa51ee251b178165917f0550fe() {
return \RectorPrefix20210715\composerRequire0f5ffdaa51ee251b178165917f0550fe(...func_get_args());
if (!function_exists('composerRequire2043d736b2ca689d52e4bedb374f5ad6')) {
function composerRequire2043d736b2ca689d52e4bedb374f5ad6() {
return \RectorPrefix20210715\composerRequire2043d736b2ca689d52e4bedb374f5ad6(...func_get_args());
}
}
if (!function_exists('parseArgs')) {