mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 16:30:51 +00:00
Updated Rector to commit 0a51a73ad6
0a51a73ad6
[CodeQuality] Remove MoveVariableDeclarationNearReferenceRector for too wide domain, not capable on most of real projects (#587)
This commit is contained in:
parent
306138dcb3
commit
54d8b7a970
|
@ -4,14 +4,12 @@ declare (strict_types=1);
|
|||
namespace RectorPrefix20210803;
|
||||
|
||||
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
|
||||
use Rector\CodeQuality\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\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector::class);
|
||||
$services->set(\Rector\CodeQuality\Rector\Variable\MoveVariableDeclarationNearReferenceRector::class);
|
||||
$services->set(\Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector::class);
|
||||
$services->set(\Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class);
|
||||
};
|
||||
|
|
|
@ -20,6 +20,7 @@ final class SetList implements \Rector\Set\Contract\SetListInterface
|
|||
*/
|
||||
public const CODE_QUALITY = __DIR__ . '/../../../config/set/code-quality.php';
|
||||
/**
|
||||
* @deprecated Use only/directly CODE_QUALITY instead
|
||||
* @var string
|
||||
*/
|
||||
public const CODE_QUALITY_STRICT = __DIR__ . '/../../../config/set/code-quality-strict.php';
|
||||
|
|
|
@ -1,209 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\CodeQuality\Rector\Variable;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\StaticPropertyFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt\Do_;
|
||||
use PhpParser\Node\Stmt\Else_;
|
||||
use PhpParser\Node\Stmt\ElseIf_;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\For_;
|
||||
use PhpParser\Node\Stmt\Foreach_;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\While_;
|
||||
use Rector\CodeQuality\UsageFinder\UsageInNextStmtFinder;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder;
|
||||
use Rector\NodeNestingScope\ParentFinder;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Tests\CodeQuality\Rector\Variable\MoveVariableDeclarationNearReferenceRector\MoveVariableDeclarationNearReferenceRectorTest
|
||||
*/
|
||||
final class MoveVariableDeclarationNearReferenceRector extends \Rector\Core\Rector\AbstractRector
|
||||
{
|
||||
/**
|
||||
* @var \Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder
|
||||
*/
|
||||
private $scopeAwareNodeFinder;
|
||||
/**
|
||||
* @var \Rector\NodeNestingScope\ParentFinder
|
||||
*/
|
||||
private $parentFinder;
|
||||
/**
|
||||
* @var \Rector\CodeQuality\UsageFinder\UsageInNextStmtFinder
|
||||
*/
|
||||
private $usageInNextStmtFinder;
|
||||
public function __construct(\Rector\NodeNestingScope\NodeFinder\ScopeAwareNodeFinder $scopeAwareNodeFinder, \Rector\NodeNestingScope\ParentFinder $parentFinder, \Rector\CodeQuality\UsageFinder\UsageInNextStmtFinder $usageInNextStmtFinder)
|
||||
{
|
||||
$this->scopeAwareNodeFinder = $scopeAwareNodeFinder;
|
||||
$this->parentFinder = $parentFinder;
|
||||
$this->usageInNextStmtFinder = $usageInNextStmtFinder;
|
||||
}
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
{
|
||||
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Move variable declaration near its reference', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
|
||||
$var = 1;
|
||||
if ($condition === null) {
|
||||
return $var;
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
if ($condition === null) {
|
||||
$var = 1;
|
||||
return $var;
|
||||
}
|
||||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [\PhpParser\Node\Expr\Variable::class];
|
||||
}
|
||||
/**
|
||||
* @param Variable $node
|
||||
*/
|
||||
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
|
||||
{
|
||||
$parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if (!($parent instanceof \PhpParser\Node\Expr\Assign && $parent->var === $node)) {
|
||||
return null;
|
||||
}
|
||||
if ($parent->expr instanceof \PhpParser\Node\Expr\ArrayDimFetch) {
|
||||
return null;
|
||||
}
|
||||
$expression = $parent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if (!$expression instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
return null;
|
||||
}
|
||||
if ($this->isUsedAsArraykeyOrInsideIfCondition($expression, $node)) {
|
||||
return null;
|
||||
}
|
||||
if ($this->hasPropertyInExpr($parent->expr)) {
|
||||
return null;
|
||||
}
|
||||
if ($this->shouldSkipReAssign($expression, $parent)) {
|
||||
return null;
|
||||
}
|
||||
$usageStmt = $this->findUsageStmt($expression, $node);
|
||||
if (!$usageStmt instanceof \PhpParser\Node) {
|
||||
return null;
|
||||
}
|
||||
if ($this->isInsideLoopStmts($usageStmt)) {
|
||||
return null;
|
||||
}
|
||||
$this->addNodeBeforeNode($expression, $usageStmt);
|
||||
$this->removeNode($expression);
|
||||
return $node;
|
||||
}
|
||||
private function isUsedAsArraykeyOrInsideIfCondition(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Variable $variable) : bool
|
||||
{
|
||||
$parentExpression = $expression->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if ($this->isUsedAsArrayKey($parentExpression, $variable)) {
|
||||
return \true;
|
||||
}
|
||||
return $this->isInsideCondition($expression);
|
||||
}
|
||||
private function hasPropertyInExpr(\PhpParser\Node\Expr $expr) : bool
|
||||
{
|
||||
return (bool) $this->betterNodeFinder->findFirst($expr, function (\PhpParser\Node $node) : bool {
|
||||
return $node instanceof \PhpParser\Node\Expr\PropertyFetch || $node instanceof \PhpParser\Node\Expr\StaticPropertyFetch;
|
||||
});
|
||||
}
|
||||
private function shouldSkipReAssign(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Assign $assign) : bool
|
||||
{
|
||||
if ($this->hasReAssign($expression, $assign->var)) {
|
||||
return \true;
|
||||
}
|
||||
return $this->hasReAssign($expression, $assign->expr);
|
||||
}
|
||||
private function isInsideLoopStmts(\PhpParser\Node $node) : bool
|
||||
{
|
||||
$loopNode = $this->parentFinder->findByTypes($node, [\PhpParser\Node\Stmt\For_::class, \PhpParser\Node\Stmt\While_::class, \PhpParser\Node\Stmt\Foreach_::class, \PhpParser\Node\Stmt\Do_::class]);
|
||||
return (bool) $loopNode;
|
||||
}
|
||||
private function isUsedAsArrayKey(?\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : bool
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node) {
|
||||
return \false;
|
||||
}
|
||||
/** @var ArrayDimFetch[] $arrayDimFetches */
|
||||
$arrayDimFetches = $this->betterNodeFinder->findInstanceOf($node, \PhpParser\Node\Expr\ArrayDimFetch::class);
|
||||
foreach ($arrayDimFetches as $arrayDimFetch) {
|
||||
/** @var Node|null $dim */
|
||||
$dim = $arrayDimFetch->dim;
|
||||
if (!$dim instanceof \PhpParser\Node) {
|
||||
continue;
|
||||
}
|
||||
$isFoundInKey = (bool) $this->betterNodeFinder->findFirst($dim, function (\PhpParser\Node $node) use($variable) : bool {
|
||||
return $this->nodeComparator->areNodesEqual($node, $variable);
|
||||
});
|
||||
if ($isFoundInKey) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
private function isInsideCondition(\PhpParser\Node\Stmt\Expression $expression) : bool
|
||||
{
|
||||
return (bool) $this->scopeAwareNodeFinder->findParentType($expression, [\PhpParser\Node\Stmt\If_::class, \PhpParser\Node\Stmt\Else_::class, \PhpParser\Node\Stmt\ElseIf_::class]);
|
||||
}
|
||||
private function hasReAssign(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr $expr) : bool
|
||||
{
|
||||
$next = $expression->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
$exprValues = $this->betterNodeFinder->find($expr, function (\PhpParser\Node $node) : bool {
|
||||
return $node instanceof \PhpParser\Node\Expr\Variable;
|
||||
});
|
||||
if ($exprValues === []) {
|
||||
return \false;
|
||||
}
|
||||
while ($next) {
|
||||
foreach ($exprValues as $exprValue) {
|
||||
$isReAssign = (bool) $this->betterNodeFinder->findFirst($next, function (\PhpParser\Node $node) : bool {
|
||||
$parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if (!$parent instanceof \PhpParser\Node\Expr\Assign) {
|
||||
return \false;
|
||||
}
|
||||
$node = $this->mayBeArrayDimFetch($node);
|
||||
return (string) $this->getName($node) === (string) $this->getName($parent->var);
|
||||
});
|
||||
if (!$isReAssign) {
|
||||
continue;
|
||||
}
|
||||
return \true;
|
||||
}
|
||||
$next = $next->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
private function mayBeArrayDimFetch(\PhpParser\Node $node) : \PhpParser\Node
|
||||
{
|
||||
$parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if ($parent instanceof \PhpParser\Node\Expr\ArrayDimFetch) {
|
||||
$node = $parent->var;
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
/**
|
||||
* @return \PhpParser\Node|null
|
||||
*/
|
||||
private function findUsageStmt(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Variable $variable)
|
||||
{
|
||||
$nextVariable = $this->usageInNextStmtFinder->getUsageInNextStmts($expression, $variable);
|
||||
if (!$nextVariable instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return null;
|
||||
}
|
||||
return $nextVariable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT);
|
||||
}
|
||||
}
|
|
@ -1,165 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\CodeQuality\UsageFinder;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\If_;
|
||||
use PhpParser\Node\Stmt\InlineHTML;
|
||||
use PhpParser\Node\Stmt\Switch_;
|
||||
use PhpParser\Node\Stmt\TryCatch;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\DeadCode\SideEffect\SideEffectNodeDetector;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class UsageInNextStmtFinder
|
||||
{
|
||||
/**
|
||||
* @var \Rector\DeadCode\SideEffect\SideEffectNodeDetector
|
||||
*/
|
||||
private $sideEffectNodeDetector;
|
||||
/**
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
/**
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
public function __construct(\Rector\DeadCode\SideEffect\SideEffectNodeDetector $sideEffectNodeDetector, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver)
|
||||
{
|
||||
$this->sideEffectNodeDetector = $sideEffectNodeDetector;
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
}
|
||||
public function getUsageInNextStmts(\PhpParser\Node\Stmt\Expression $expression, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
/** @var Node|null $next */
|
||||
$next = $expression->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
if (!$next instanceof \PhpParser\Node) {
|
||||
return null;
|
||||
}
|
||||
if ($next instanceof \PhpParser\Node\Stmt\InlineHTML) {
|
||||
return null;
|
||||
}
|
||||
if ($this->hasCall($next)) {
|
||||
return null;
|
||||
}
|
||||
$countFound = $this->getCountFound($next, $variable);
|
||||
if ($countFound === 0) {
|
||||
return null;
|
||||
}
|
||||
if ($countFound >= 2) {
|
||||
return null;
|
||||
}
|
||||
$nextVariable = $this->getSameVarName([$next], $variable);
|
||||
if ($nextVariable instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return $nextVariable;
|
||||
}
|
||||
return $this->getSameVarNameInNexts($next, $variable);
|
||||
}
|
||||
private function hasCall(\PhpParser\Node $node) : bool
|
||||
{
|
||||
return (bool) $this->betterNodeFinder->findFirst($node, function (\PhpParser\Node $n) : bool {
|
||||
return $this->sideEffectNodeDetector->detectCallExpr($n);
|
||||
});
|
||||
}
|
||||
private function getCountFound(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : int
|
||||
{
|
||||
$countFound = 0;
|
||||
while ($node) {
|
||||
$isFound = (bool) $this->getSameVarName([$node], $variable);
|
||||
if ($isFound) {
|
||||
++$countFound;
|
||||
}
|
||||
$countFound = $this->countWithElseIf($node, $variable, $countFound);
|
||||
$countFound = $this->countWithTryCatch($node, $variable, $countFound);
|
||||
$countFound = $this->countWithSwitchCase($node, $variable, $countFound);
|
||||
/** @var Node|null $node */
|
||||
$node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function getSameVarNameInNexts(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
while ($node) {
|
||||
$found = $this->getSameVarName([$node], $variable);
|
||||
if ($found instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return $found;
|
||||
}
|
||||
/** @var Node|null $node */
|
||||
$node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::NEXT_NODE);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function countWithElseIf(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\If_) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundElseIf = (bool) $this->getSameVarName($node->elseifs, $variable);
|
||||
$isFoundElse = (bool) $this->getSameVarName([$node->else], $variable);
|
||||
if ($isFoundElseIf || $isFoundElse) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function countWithTryCatch(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\TryCatch) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundInCatch = (bool) $this->getSameVarName($node->catches, $variable);
|
||||
$isFoundInFinally = (bool) $this->getSameVarName([$node->finally], $variable);
|
||||
if ($isFoundInCatch || $isFoundInFinally) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
private function countWithSwitchCase(\PhpParser\Node $node, \PhpParser\Node\Expr\Variable $variable, int $countFound) : int
|
||||
{
|
||||
if (!$node instanceof \PhpParser\Node\Stmt\Switch_) {
|
||||
return $countFound;
|
||||
}
|
||||
$isFoundInCases = (bool) $this->getSameVarName($node->cases, $variable);
|
||||
if ($isFoundInCases) {
|
||||
++$countFound;
|
||||
}
|
||||
return $countFound;
|
||||
}
|
||||
/**
|
||||
* @param array<int, Node|null> $multiNodes
|
||||
*/
|
||||
private function getSameVarName(array $multiNodes, \PhpParser\Node\Expr\Variable $variable) : ?\PhpParser\Node\Expr\Variable
|
||||
{
|
||||
foreach ($multiNodes as $multiNode) {
|
||||
if ($multiNode === null) {
|
||||
continue;
|
||||
}
|
||||
/** @var Variable|null $found */
|
||||
$found = $this->betterNodeFinder->findFirst($multiNode, function (\PhpParser\Node $currentNode) use($variable) : bool {
|
||||
$currentNode = $this->unwrapArrayDimFetch($currentNode);
|
||||
if (!$currentNode instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return \false;
|
||||
}
|
||||
return $this->nodeNameResolver->isName($currentNode, (string) $this->nodeNameResolver->getName($variable));
|
||||
});
|
||||
if ($found !== null) {
|
||||
return $found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private function unwrapArrayDimFetch(\PhpParser\Node $node) : \PhpParser\Node
|
||||
{
|
||||
$parent = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
while ($parent instanceof \PhpParser\Node\Expr\ArrayDimFetch) {
|
||||
$node = $parent->var;
|
||||
$parent = $parent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
}
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'aff0c5d90c327386f6d253fbf05f5f3e1ac9e0c7';
|
||||
public const PACKAGE_VERSION = '0a51a73ad61b0ec2f9195ead66880e71a0e6779b';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-08-03 19:10:53';
|
||||
public const RELEASE_DATE = '2021-08-03 19:55:29';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20210803\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717::getLoader();
|
||||
return ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6::getLoader();
|
||||
|
|
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
|
@ -1678,10 +1678,8 @@ return array(
|
|||
'Rector\\CodeQuality\\Rector\\Ternary\\SimplifyTautologyTernaryRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/SimplifyTautologyTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\SwitchNegatedTernaryRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/SwitchNegatedTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\UnnecessaryTernaryExpressionRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/UnnecessaryTernaryExpressionRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => $baseDir . '/rules/CodeQuality/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\ArrayDimFetchTypeResolver' => $baseDir . '/rules/CodeQuality/TypeResolver/ArrayDimFetchTypeResolver.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\AssignVariableTypeResolver' => $baseDir . '/rules/CodeQuality/TypeResolver/AssignVariableTypeResolver.php',
|
||||
'Rector\\CodeQuality\\UsageFinder\\UsageInNextStmtFinder' => $baseDir . '/rules/CodeQuality/UsageFinder/UsageInNextStmtFinder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsAdder' => $baseDir . '/rules/CodingStyle/Application/UseImportsAdder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsRemover' => $baseDir . '/rules/CodingStyle/Application/UseImportsRemover.php',
|
||||
'Rector\\CodingStyle\\ClassNameImport\\AliasUsesResolver' => $baseDir . '/rules/CodingStyle/ClassNameImport/AliasUsesResolver.php',
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717
|
||||
class ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6', '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\ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire32c29e43a9fe8c7d3b9861a866762717($fileIdentifier, $file);
|
||||
composerRequire9f1ed2c5f6463d5bc2ac8ae6b3efdcc6($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire32c29e43a9fe8c7d3b9861a866762717($fileIdentifier, $file)
|
||||
function composerRequire9f1ed2c5f6463d5bc2ac8ae6b3efdcc6($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
|
10
vendor/composer/autoload_static.php
vendored
10
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717
|
||||
class ComposerStaticInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
@ -2038,10 +2038,8 @@ class ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717
|
|||
'Rector\\CodeQuality\\Rector\\Ternary\\SimplifyTautologyTernaryRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/SimplifyTautologyTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\SwitchNegatedTernaryRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/SwitchNegatedTernaryRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Ternary\\UnnecessaryTernaryExpressionRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/UnnecessaryTernaryExpressionRector.php',
|
||||
'Rector\\CodeQuality\\Rector\\Variable\\MoveVariableDeclarationNearReferenceRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\ArrayDimFetchTypeResolver' => __DIR__ . '/../..' . '/rules/CodeQuality/TypeResolver/ArrayDimFetchTypeResolver.php',
|
||||
'Rector\\CodeQuality\\TypeResolver\\AssignVariableTypeResolver' => __DIR__ . '/../..' . '/rules/CodeQuality/TypeResolver/AssignVariableTypeResolver.php',
|
||||
'Rector\\CodeQuality\\UsageFinder\\UsageInNextStmtFinder' => __DIR__ . '/../..' . '/rules/CodeQuality/UsageFinder/UsageInNextStmtFinder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsAdder' => __DIR__ . '/../..' . '/rules/CodingStyle/Application/UseImportsAdder.php',
|
||||
'Rector\\CodingStyle\\Application\\UseImportsRemover' => __DIR__ . '/../..' . '/rules/CodingStyle/Application/UseImportsRemover.php',
|
||||
'Rector\\CodingStyle\\ClassNameImport\\AliasUsesResolver' => __DIR__ . '/../..' . '/rules/CodingStyle/ClassNameImport/AliasUsesResolver.php',
|
||||
|
@ -3847,9 +3845,9 @@ class ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit32c29e43a9fe8c7d3b9861a866762717::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -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('RectorPrefix20210803\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717', false) && !interface_exists('ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717', false) && !trait_exists('ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717', false)) {
|
||||
spl_autoload_call('RectorPrefix20210803\ComposerAutoloaderInit32c29e43a9fe8c7d3b9861a866762717');
|
||||
if (!class_exists('ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6', false) && !interface_exists('ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6', false) && !trait_exists('ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6', false)) {
|
||||
spl_autoload_call('RectorPrefix20210803\ComposerAutoloaderInit9f1ed2c5f6463d5bc2ac8ae6b3efdcc6');
|
||||
}
|
||||
if (!class_exists('AjaxLogin', false) && !interface_exists('AjaxLogin', false) && !trait_exists('AjaxLogin', false)) {
|
||||
spl_autoload_call('RectorPrefix20210803\AjaxLogin');
|
||||
|
@ -3305,9 +3305,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20210803\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire32c29e43a9fe8c7d3b9861a866762717')) {
|
||||
function composerRequire32c29e43a9fe8c7d3b9861a866762717() {
|
||||
return \RectorPrefix20210803\composerRequire32c29e43a9fe8c7d3b9861a866762717(...func_get_args());
|
||||
if (!function_exists('composerRequire9f1ed2c5f6463d5bc2ac8ae6b3efdcc6')) {
|
||||
function composerRequire9f1ed2c5f6463d5bc2ac8ae6b3efdcc6() {
|
||||
return \RectorPrefix20210803\composerRequire9f1ed2c5f6463d5bc2ac8ae6b3efdcc6(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('parseArgs')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user