mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 08:50:50 +00:00
Updated Rector to commit b0a6173550
b0a6173550
[DeadCode] Add RemoveJustPropertyFetchRector (#2433)
This commit is contained in:
parent
63ef476ebe
commit
03ef1cdc0b
|
@ -325,9 +325,8 @@ final class PhpDocInfo
|
|||
{
|
||||
$paramTypesByName = [];
|
||||
foreach ($this->phpDocNode->getParamTagValues() as $paramTagValueNode) {
|
||||
$parameterName = $paramTagValueNode->parameterName;
|
||||
$parameterType = $this->staticTypeMapper->mapPHPStanPhpDocTypeToPHPStanType($paramTagValueNode, $this->node);
|
||||
$paramTypesByName[$parameterName] = $parameterType;
|
||||
$paramTypesByName[$paramTagValueNode->parameterName] = $parameterType;
|
||||
}
|
||||
return $paramTypesByName;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ final class BinaryOpConditionsCollector
|
|||
while ($expr instanceof \PhpParser\Node\Expr\BinaryOp) {
|
||||
$conditions[] = $expr->right;
|
||||
$expr = $expr->left;
|
||||
if (\get_class($expr) !== $binaryOpClass) {
|
||||
if ($binaryOpClass !== \get_class($expr)) {
|
||||
$conditions[] = $expr;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -71,8 +71,7 @@ final class ArrayCallableMethodMatcher
|
|||
*/
|
||||
public function match(\PhpParser\Node\Expr\Array_ $array)
|
||||
{
|
||||
$arrayItems = $array->items;
|
||||
if (\count($arrayItems) !== 2) {
|
||||
if (\count($array->items) !== 2) {
|
||||
return null;
|
||||
}
|
||||
if ($this->shouldSkipNullItems($array)) {
|
||||
|
|
|
@ -45,9 +45,8 @@ final class DocBlockNamespaceRenamer
|
|||
if (!$docNode instanceof \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode) {
|
||||
return null;
|
||||
}
|
||||
$name = $docNode->name;
|
||||
$trimmedName = \ltrim($docNode->name, '\\');
|
||||
if ($name === $trimmedName) {
|
||||
if ($docNode->name === $trimmedName) {
|
||||
return null;
|
||||
}
|
||||
$renamedNamespaceValueObject = $this->namespaceMatcher->matchRenamedNamespace($trimmedName, $oldToNewNamespaces);
|
||||
|
|
|
@ -33,9 +33,10 @@ final class AttributeArrayNameInliner
|
|||
if (!$arrayItem instanceof \PhpParser\Node\Expr\ArrayItem) {
|
||||
continue;
|
||||
}
|
||||
$key = $arrayItem->key;
|
||||
if ($key instanceof \PhpParser\Node\Scalar\String_) {
|
||||
$args[] = new \PhpParser\Node\Arg($arrayItem->value, \false, \false, [], new \PhpParser\Node\Identifier($key->value));
|
||||
if ($arrayItem->key instanceof \PhpParser\Node\Scalar\String_) {
|
||||
$string = $arrayItem->key;
|
||||
$argumentName = new \PhpParser\Node\Identifier($string->value);
|
||||
$args[] = new \PhpParser\Node\Arg($arrayItem->value, \false, \false, [], $argumentName);
|
||||
} else {
|
||||
$args[] = new \PhpParser\Node\Arg($arrayItem->value);
|
||||
}
|
||||
|
|
|
@ -99,8 +99,7 @@ final class IdentifierTypeMapper implements \Rector\StaticTypeMapper\Contract\Ph
|
|||
return new \PHPStan\Type\IterableType(new \PHPStan\Type\MixedType(), new \PHPStan\Type\MixedType());
|
||||
}
|
||||
if (\strncmp($typeNode->name, '\\', \strlen('\\')) === 0) {
|
||||
$type = $typeNode->name;
|
||||
$typeWithoutPreslash = \RectorPrefix20220604\Nette\Utils\Strings::substring($type, 1);
|
||||
$typeWithoutPreslash = \RectorPrefix20220604\Nette\Utils\Strings::substring($typeNode->name, 1);
|
||||
$objectType = new \Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType($typeWithoutPreslash);
|
||||
} else {
|
||||
if ($typeNode->name === 'scalar') {
|
||||
|
|
|
@ -42,9 +42,8 @@ final class NullableTypeMapper implements \Rector\StaticTypeMapper\Contract\PhpD
|
|||
*/
|
||||
public function mapToPHPStanType(\PHPStan\PhpDocParser\Ast\Type\TypeNode $typeNode, \PhpParser\Node $node, \PHPStan\Analyser\NameScope $nameScope) : \PHPStan\Type\Type
|
||||
{
|
||||
$type = $typeNode->type;
|
||||
if ($type instanceof \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode) {
|
||||
$type = $this->identifierTypeMapper->mapToPHPStanType($type, $node, $nameScope);
|
||||
if ($typeNode->type instanceof \PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode) {
|
||||
$type = $this->identifierTypeMapper->mapToPHPStanType($typeNode->type, $node, $nameScope);
|
||||
return new \PHPStan\Type\UnionType([new \PHPStan\Type\NullType(), $type]);
|
||||
}
|
||||
// fallback to PHPStan resolver
|
||||
|
|
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\Rector\StmtsAwareInterface;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PhpParser\Node\Stmt\While_;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
|
||||
use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\DeadCode\ValueObject\PropertyFetchToVariableAssign;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\ReadWrite\NodeFinder\NodeUsageFinder;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Tests\DeadCode\Rector\StmtsAwareInterface\RemoveJustPropertyFetchRector\RemoveJustPropertyFetchRectorTest
|
||||
*/
|
||||
final class RemoveJustPropertyFetchRector extends \Rector\Core\Rector\AbstractRector
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\ReadWrite\NodeFinder\NodeUsageFinder
|
||||
*/
|
||||
private $nodeUsageFinder;
|
||||
public function __construct(\Rector\ReadWrite\NodeFinder\NodeUsageFinder $nodeUsageFinder)
|
||||
{
|
||||
$this->nodeUsageFinder = $nodeUsageFinder;
|
||||
}
|
||||
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
|
||||
{
|
||||
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Inline property fetch assign to a variable, that has no added value', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
|
||||
final class SomeClass
|
||||
{
|
||||
private $name;
|
||||
|
||||
public function run()
|
||||
{
|
||||
$name = $this->name;
|
||||
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
final class SomeClass
|
||||
{
|
||||
private $name;
|
||||
|
||||
public function run()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [\Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface::class];
|
||||
}
|
||||
/**
|
||||
* @param StmtsAwareInterface $node
|
||||
*/
|
||||
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
|
||||
{
|
||||
$stmts = (array) $node->stmts;
|
||||
if ($stmts === []) {
|
||||
return null;
|
||||
}
|
||||
$variableUsages = [];
|
||||
$currentStmtKey = null;
|
||||
$variableToPropertyAssign = null;
|
||||
foreach ($stmts as $key => $stmt) {
|
||||
$variableToPropertyAssign = $this->matchVariableToPropertyAssign($stmt);
|
||||
if (!$variableToPropertyAssign instanceof \Rector\DeadCode\ValueObject\PropertyFetchToVariableAssign) {
|
||||
continue;
|
||||
}
|
||||
$assignPhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($stmt);
|
||||
// there is a @var tag on purpose, keep the assign
|
||||
if ($assignPhpDocInfo->getVarTagValueNode() instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
$followingStmts = \array_slice($stmts, $key + 1);
|
||||
$variableUsages = $this->nodeUsageFinder->findVariableUsages($followingStmts, $variableToPropertyAssign->getVariable());
|
||||
$currentStmtKey = $key;
|
||||
// @todo validate the variable is not used in some place where property fetch cannot be used
|
||||
break;
|
||||
}
|
||||
// filter out variable usages that are part of nested property fetch, or change variable
|
||||
$variableUsages = $this->filterOutReferencedVariableUsages($variableUsages);
|
||||
if (!$variableToPropertyAssign instanceof \Rector\DeadCode\ValueObject\PropertyFetchToVariableAssign) {
|
||||
return null;
|
||||
}
|
||||
if ($variableUsages === []) {
|
||||
return null;
|
||||
}
|
||||
/** @var int $currentStmtKey */
|
||||
return $this->replaceVariablesWithPropertyFetch($node, $currentStmtKey, $variableUsages, $variableToPropertyAssign->getPropertyFetch());
|
||||
}
|
||||
/**
|
||||
* @param Variable[] $variableUsages
|
||||
*/
|
||||
private function replaceVariablesWithPropertyFetch(\Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface $stmtsAware, int $currentStmtsKey, array $variableUsages, \PhpParser\Node\Expr\PropertyFetch $propertyFetch) : \Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface
|
||||
{
|
||||
// remove assign node
|
||||
unset($stmtsAware->stmts[$currentStmtsKey]);
|
||||
$this->traverseNodesWithCallable($stmtsAware, function (\PhpParser\Node $node) use($variableUsages, $propertyFetch) : ?PropertyFetch {
|
||||
if (!\in_array($node, $variableUsages, \true)) {
|
||||
return null;
|
||||
}
|
||||
return $propertyFetch;
|
||||
});
|
||||
return $stmtsAware;
|
||||
}
|
||||
/**
|
||||
* @param Variable[] $variableUsages
|
||||
* @return Variable[]
|
||||
*/
|
||||
private function filterOutReferencedVariableUsages(array $variableUsages) : array
|
||||
{
|
||||
return \array_filter($variableUsages, function (\PhpParser\Node\Expr\Variable $variable) : bool {
|
||||
$variableUsageParent = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if ($variableUsageParent instanceof \PhpParser\Node\Arg) {
|
||||
$variableUsageParent = $variableUsageParent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
}
|
||||
// skip nested property fetch, the assign is for purpose of named variable
|
||||
if ($variableUsageParent instanceof \PhpParser\Node\Expr\PropertyFetch) {
|
||||
return \false;
|
||||
}
|
||||
// skip, as assign can be used in a loop
|
||||
$parentWhile = $this->betterNodeFinder->findParentType($variable, \PhpParser\Node\Stmt\While_::class);
|
||||
if ($parentWhile instanceof \PhpParser\Node\Stmt\While_) {
|
||||
return \false;
|
||||
}
|
||||
if (!$variableUsageParent instanceof \PhpParser\Node\Expr\FuncCall) {
|
||||
return \true;
|
||||
}
|
||||
return !$this->isName($variableUsageParent, 'array_pop');
|
||||
});
|
||||
}
|
||||
private function matchVariableToPropertyAssign(\PhpParser\Node\Stmt $stmt) : ?\Rector\DeadCode\ValueObject\PropertyFetchToVariableAssign
|
||||
{
|
||||
if (!$stmt instanceof \PhpParser\Node\Stmt\Expression) {
|
||||
return null;
|
||||
}
|
||||
if (!$stmt->expr instanceof \PhpParser\Node\Expr\Assign) {
|
||||
return null;
|
||||
}
|
||||
$assign = $stmt->expr;
|
||||
if (!$assign->expr instanceof \PhpParser\Node\Expr\PropertyFetch) {
|
||||
return null;
|
||||
}
|
||||
// keep property fetch nesting
|
||||
if ($assign->expr->var instanceof \PhpParser\Node\Expr\PropertyFetch) {
|
||||
return null;
|
||||
}
|
||||
if (!$assign->var instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return null;
|
||||
}
|
||||
return new \Rector\DeadCode\ValueObject\PropertyFetchToVariableAssign($assign->var, $assign->expr);
|
||||
}
|
||||
}
|
33
rules/DeadCode/ValueObject/PropertyFetchToVariableAssign.php
Normal file
33
rules/DeadCode/ValueObject/PropertyFetchToVariableAssign.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\ValueObject;
|
||||
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
final class PropertyFetchToVariableAssign
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \PhpParser\Node\Expr\Variable
|
||||
*/
|
||||
private $variable;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \PhpParser\Node\Expr\PropertyFetch
|
||||
*/
|
||||
private $propertyFetch;
|
||||
public function __construct(\PhpParser\Node\Expr\Variable $variable, \PhpParser\Node\Expr\PropertyFetch $propertyFetch)
|
||||
{
|
||||
$this->variable = $variable;
|
||||
$this->propertyFetch = $propertyFetch;
|
||||
}
|
||||
public function getVariable() : \PhpParser\Node\Expr\Variable
|
||||
{
|
||||
return $this->variable;
|
||||
}
|
||||
public function getPropertyFetch() : \PhpParser\Node\Expr\PropertyFetch
|
||||
{
|
||||
return $this->propertyFetch;
|
||||
}
|
||||
}
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '70261b71b70282bc9bdbd749819825885b4c9d1c';
|
||||
public const PACKAGE_VERSION = 'b0a61735508fdcf1adf33b9f8df7950666864c82';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-06-04 13:12:01';
|
||||
public const RELEASE_DATE = '2022-06-04 17:31:24';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -27,11 +27,10 @@ final class CompactFuncCallAnalyzer
|
|||
if (!$this->nodeNameResolver->isName($funcCall, 'compact')) {
|
||||
return \false;
|
||||
}
|
||||
$variableName = $variable->name;
|
||||
if (!\is_string($variableName)) {
|
||||
if (!\is_string($variable->name)) {
|
||||
return \false;
|
||||
}
|
||||
return $this->isInArgOrArrayItemNodes($funcCall->args, $variableName);
|
||||
return $this->isInArgOrArrayItemNodes($funcCall->args, $variable->name);
|
||||
}
|
||||
/**
|
||||
* @param array<int, Arg|VariadicPlaceholder|ArrayItem|null> $nodes
|
||||
|
|
|
@ -39,8 +39,7 @@ final class ArrayManipulator
|
|||
if (!$item instanceof \PhpParser\Node\Expr\ArrayItem) {
|
||||
continue;
|
||||
}
|
||||
$key = $item->key;
|
||||
if (!$this->isAllowedArrayKey($key)) {
|
||||
if (!$this->isAllowedArrayKey($item->key)) {
|
||||
return \true;
|
||||
}
|
||||
$value = $item->value;
|
||||
|
|
|
@ -13,11 +13,10 @@ final class ForeachManipulator
|
|||
*/
|
||||
public function matchOnlyStmt(\PhpParser\Node\Stmt\Foreach_ $foreach, callable $callable) : ?\PhpParser\Node
|
||||
{
|
||||
$stmts = $foreach->stmts;
|
||||
if (\count($stmts) !== 1) {
|
||||
if (\count($foreach->stmts) !== 1) {
|
||||
return null;
|
||||
}
|
||||
$innerNode = $stmts[0];
|
||||
$innerNode = $foreach->stmts[0];
|
||||
$innerNode = $innerNode instanceof \PhpParser\Node\Stmt\Expression ? $innerNode->expr : $innerNode;
|
||||
return $callable($innerNode, $foreach);
|
||||
}
|
||||
|
|
|
@ -70,11 +70,10 @@ final class IfManipulator
|
|||
*/
|
||||
public function matchIfNotNullReturnValue(\PhpParser\Node\Stmt\If_ $if) : ?\PhpParser\Node\Expr
|
||||
{
|
||||
$stmts = $if->stmts;
|
||||
if (\count($stmts) !== 1) {
|
||||
if (\count($if->stmts) !== 1) {
|
||||
return null;
|
||||
}
|
||||
$insideIfNode = $stmts[0];
|
||||
$insideIfNode = $if->stmts[0];
|
||||
if (!$insideIfNode instanceof \PhpParser\Node\Stmt\Return_) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -157,8 +157,7 @@ final class VariableManipulator
|
|||
if (!$assign->var instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return \false;
|
||||
}
|
||||
$variable = $assign->var;
|
||||
$variableUsages = $this->collectVariableUsages($classMethod, $variable, $assign);
|
||||
$variableUsages = $this->collectVariableUsages($classMethod, $assign->var, $assign);
|
||||
foreach ($variableUsages as $variableUsage) {
|
||||
$parent = $variableUsage->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
|
||||
if ($parent instanceof \PhpParser\Node\Arg && !$this->variableToConstantGuard->isReadArg($parent)) {
|
||||
|
|
|
@ -30,10 +30,10 @@ final class ConditionSearcher
|
|||
}
|
||||
public function hasIfAndElseForVariableRedeclaration(\PhpParser\Node\Expr\Assign $assign, \PhpParser\Node\Stmt\If_ $if) : bool
|
||||
{
|
||||
$elseNode = $if->else;
|
||||
if (!$elseNode instanceof \PhpParser\Node\Stmt\Else_) {
|
||||
if (!$if->else instanceof \PhpParser\Node\Stmt\Else_) {
|
||||
return \false;
|
||||
}
|
||||
$ifElse = $if->else;
|
||||
/** @var Variable $varNode */
|
||||
$varNode = $assign->var;
|
||||
if (!$this->hasVariableRedeclaration($varNode, $if->stmts)) {
|
||||
|
@ -50,7 +50,7 @@ final class ConditionSearcher
|
|||
if ($isInCond) {
|
||||
return \false;
|
||||
}
|
||||
return $this->hasVariableRedeclaration($varNode, $elseNode->stmts);
|
||||
return $this->hasVariableRedeclaration($varNode, $ifElse->stmts);
|
||||
}
|
||||
/**
|
||||
* @param Stmt[] $stmts
|
||||
|
@ -86,10 +86,11 @@ final class ConditionSearcher
|
|||
if (!$stmt->expr instanceof \PhpParser\Node\Expr\Assign) {
|
||||
return \false;
|
||||
}
|
||||
$assignVar = $stmt->expr->var;
|
||||
if (!$assignVar instanceof \PhpParser\Node\Expr\Variable) {
|
||||
$assign = $stmt->expr;
|
||||
if (!$assign->var instanceof \PhpParser\Node\Expr\Variable) {
|
||||
return \false;
|
||||
}
|
||||
return $variable->name === $assignVar->name;
|
||||
$assignedVariable = $assign->var;
|
||||
return $variable->name === $assignedVariable->name;
|
||||
}
|
||||
}
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef::getLoader();
|
||||
return ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78::getLoader();
|
||||
|
|
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
|
@ -1812,6 +1812,7 @@ return array(
|
|||
'Rector\\DeadCode\\Rector\\StaticCall\\RemoveParentCallWithoutParentRector' => $baseDir . '/rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php',
|
||||
'Rector\\DeadCode\\Rector\\Stmt\\RemoveUnreachableStatementRector' => $baseDir . '/rules/DeadCode/Rector/Stmt/RemoveUnreachableStatementRector.php',
|
||||
'Rector\\DeadCode\\Rector\\StmtsAwareInterface\\RemoveJustPropertyFetchForAssignRector' => $baseDir . '/rules/DeadCode/Rector/StmtsAwareInterface/RemoveJustPropertyFetchForAssignRector.php',
|
||||
'Rector\\DeadCode\\Rector\\StmtsAwareInterface\\RemoveJustPropertyFetchRector' => $baseDir . '/rules/DeadCode/Rector/StmtsAwareInterface/RemoveJustPropertyFetchRector.php',
|
||||
'Rector\\DeadCode\\Rector\\Switch_\\RemoveDuplicatedCaseInSwitchRector' => $baseDir . '/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php',
|
||||
'Rector\\DeadCode\\Rector\\Ternary\\TernaryToBooleanOrFalseToBooleanAndRector' => $baseDir . '/rules/DeadCode/Rector/Ternary/TernaryToBooleanOrFalseToBooleanAndRector.php',
|
||||
'Rector\\DeadCode\\Rector\\TryCatch\\RemoveDeadTryCatchRector' => $baseDir . '/rules/DeadCode/Rector/TryCatch/RemoveDeadTryCatchRector.php',
|
||||
|
@ -1821,6 +1822,7 @@ return array(
|
|||
'Rector\\DeadCode\\TypeNodeAnalyzer\\MixedArrayTypeNodeAnalyzer' => $baseDir . '/rules/DeadCode/TypeNodeAnalyzer/MixedArrayTypeNodeAnalyzer.php',
|
||||
'Rector\\DeadCode\\UselessIfCondBeforeForeachDetector' => $baseDir . '/rules/DeadCode/UselessIfCondBeforeForeachDetector.php',
|
||||
'Rector\\DeadCode\\ValueObject\\BinaryToVersionCompareCondition' => $baseDir . '/rules/DeadCode/ValueObject/BinaryToVersionCompareCondition.php',
|
||||
'Rector\\DeadCode\\ValueObject\\PropertyFetchToVariableAssign' => $baseDir . '/rules/DeadCode/ValueObject/PropertyFetchToVariableAssign.php',
|
||||
'Rector\\DeadCode\\ValueObject\\VariableAndPropertyFetchAssign' => $baseDir . '/rules/DeadCode/ValueObject/VariableAndPropertyFetchAssign.php',
|
||||
'Rector\\DeadCode\\ValueObject\\VariableNodeUse' => $baseDir . '/rules/DeadCode/ValueObject/VariableNodeUse.php',
|
||||
'Rector\\DeadCode\\ValueObject\\VersionCompareCondition' => $baseDir . '/rules/DeadCode/ValueObject/VersionCompareCondition.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 ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef
|
||||
class ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,19 +22,19 @@ class ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitcd109bfaf077a7f2657c468440727e78::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitcd109bfaf077a7f2657c468440727e78::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirec94c6e503b4a43bcfd0da89630c243ef($fileIdentifier, $file);
|
||||
composerRequirecd109bfaf077a7f2657c468440727e78($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -46,7 +46,7 @@ class ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequirec94c6e503b4a43bcfd0da89630c243ef($fileIdentifier, $file)
|
||||
function composerRequirecd109bfaf077a7f2657c468440727e78($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
10
vendor/composer/autoload_static.php
vendored
10
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef
|
||||
class ComposerStaticInitcd109bfaf077a7f2657c468440727e78
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
|
@ -2133,6 +2133,7 @@ class ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef
|
|||
'Rector\\DeadCode\\Rector\\StaticCall\\RemoveParentCallWithoutParentRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/StaticCall/RemoveParentCallWithoutParentRector.php',
|
||||
'Rector\\DeadCode\\Rector\\Stmt\\RemoveUnreachableStatementRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/Stmt/RemoveUnreachableStatementRector.php',
|
||||
'Rector\\DeadCode\\Rector\\StmtsAwareInterface\\RemoveJustPropertyFetchForAssignRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/StmtsAwareInterface/RemoveJustPropertyFetchForAssignRector.php',
|
||||
'Rector\\DeadCode\\Rector\\StmtsAwareInterface\\RemoveJustPropertyFetchRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/StmtsAwareInterface/RemoveJustPropertyFetchRector.php',
|
||||
'Rector\\DeadCode\\Rector\\Switch_\\RemoveDuplicatedCaseInSwitchRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php',
|
||||
'Rector\\DeadCode\\Rector\\Ternary\\TernaryToBooleanOrFalseToBooleanAndRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/Ternary/TernaryToBooleanOrFalseToBooleanAndRector.php',
|
||||
'Rector\\DeadCode\\Rector\\TryCatch\\RemoveDeadTryCatchRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/TryCatch/RemoveDeadTryCatchRector.php',
|
||||
|
@ -2142,6 +2143,7 @@ class ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef
|
|||
'Rector\\DeadCode\\TypeNodeAnalyzer\\MixedArrayTypeNodeAnalyzer' => __DIR__ . '/../..' . '/rules/DeadCode/TypeNodeAnalyzer/MixedArrayTypeNodeAnalyzer.php',
|
||||
'Rector\\DeadCode\\UselessIfCondBeforeForeachDetector' => __DIR__ . '/../..' . '/rules/DeadCode/UselessIfCondBeforeForeachDetector.php',
|
||||
'Rector\\DeadCode\\ValueObject\\BinaryToVersionCompareCondition' => __DIR__ . '/../..' . '/rules/DeadCode/ValueObject/BinaryToVersionCompareCondition.php',
|
||||
'Rector\\DeadCode\\ValueObject\\PropertyFetchToVariableAssign' => __DIR__ . '/../..' . '/rules/DeadCode/ValueObject/PropertyFetchToVariableAssign.php',
|
||||
'Rector\\DeadCode\\ValueObject\\VariableAndPropertyFetchAssign' => __DIR__ . '/../..' . '/rules/DeadCode/ValueObject/VariableAndPropertyFetchAssign.php',
|
||||
'Rector\\DeadCode\\ValueObject\\VariableNodeUse' => __DIR__ . '/../..' . '/rules/DeadCode/ValueObject/VariableNodeUse.php',
|
||||
'Rector\\DeadCode\\ValueObject\\VersionCompareCondition' => __DIR__ . '/../..' . '/rules/DeadCode/ValueObject/VersionCompareCondition.php',
|
||||
|
@ -3789,9 +3791,9 @@ class ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitc94c6e503b4a43bcfd0da89630c243ef::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitcd109bfaf077a7f2657c468440727e78::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitcd109bfaf077a7f2657c468440727e78::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitcd109bfaf077a7f2657c468440727e78::$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('RectorPrefix20220604\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef', false) && !interface_exists('ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef', false) && !trait_exists('ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef', false)) {
|
||||
spl_autoload_call('RectorPrefix20220604\ComposerAutoloaderInitc94c6e503b4a43bcfd0da89630c243ef');
|
||||
if (!class_exists('ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78', false) && !interface_exists('ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78', false) && !trait_exists('ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78', false)) {
|
||||
spl_autoload_call('RectorPrefix20220604\ComposerAutoloaderInitcd109bfaf077a7f2657c468440727e78');
|
||||
}
|
||||
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('RectorPrefix20220604\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
|
@ -56,9 +56,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20220604\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequirec94c6e503b4a43bcfd0da89630c243ef')) {
|
||||
function composerRequirec94c6e503b4a43bcfd0da89630c243ef() {
|
||||
return \RectorPrefix20220604\composerRequirec94c6e503b4a43bcfd0da89630c243ef(...func_get_args());
|
||||
if (!function_exists('composerRequirecd109bfaf077a7f2657c468440727e78')) {
|
||||
function composerRequirecd109bfaf077a7f2657c468440727e78() {
|
||||
return \RectorPrefix20220604\composerRequirecd109bfaf077a7f2657c468440727e78(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user