mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
Updated Rector to commit f608461e44c6a4008a2bff6c603ba9d52d3ffacf
f608461e44
Remove RemoveOverriddenValuesRector as flow of control is not reliable and could cause invalid removal (#2614)
This commit is contained in:
parent
3737ef475a
commit
8c06162529
@ -32,7 +32,6 @@ use Rector\DeadCode\Rector\For_\RemoveDeadLoopRector;
|
||||
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
|
||||
use Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector;
|
||||
use Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector;
|
||||
use Rector\DeadCode\Rector\FunctionLike\RemoveOverriddenValuesRector;
|
||||
use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector;
|
||||
use Rector\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector;
|
||||
use Rector\DeadCode\Rector\If_\SimplifyIfElseWithSameContentRector;
|
||||
@ -62,7 +61,6 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
RemoveEmptyClassMethodRector::class,
|
||||
RemoveDoubleAssignRector::class,
|
||||
SimplifyMirrorAssignRector::class,
|
||||
RemoveOverriddenValuesRector::class,
|
||||
RemoveUnusedPrivatePropertyRector::class,
|
||||
RemoveUnusedPrivateClassConstantRector::class,
|
||||
RemoveUnusedPrivateMethodRector::class,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\NodeNestingScope;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class FlowOfControlLocator
|
||||
{
|
||||
public function resolveNestingHashFromFunctionLike(FunctionLike $functionLike, Node $checkedNode) : string
|
||||
{
|
||||
$nestingHash = \spl_object_hash($functionLike) . '__';
|
||||
$currentNode = $checkedNode;
|
||||
$previous = $currentNode;
|
||||
while ($currentNode = $currentNode->getAttribute(AttributeKey::PARENT_NODE)) {
|
||||
if ($currentNode instanceof Expression) {
|
||||
continue;
|
||||
}
|
||||
if (!$currentNode instanceof Node) {
|
||||
break;
|
||||
}
|
||||
if ($functionLike === $currentNode) {
|
||||
// to high
|
||||
break;
|
||||
}
|
||||
$nestingHash .= $this->resolveBinaryOpNestingHash($currentNode, $previous);
|
||||
$nestingHash .= \spl_object_hash($currentNode);
|
||||
$previous = $currentNode;
|
||||
}
|
||||
return $nestingHash;
|
||||
}
|
||||
private function resolveBinaryOpNestingHash(Node $currentNode, Node $previous) : string
|
||||
{
|
||||
if (!$currentNode instanceof BinaryOp) {
|
||||
return '';
|
||||
}
|
||||
// left && right have differnt nesting
|
||||
if ($currentNode->left === $previous) {
|
||||
return 'binary_left__';
|
||||
}
|
||||
if ($currentNode->right === $previous) {
|
||||
return 'binary_right__';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\NodeCollector;
|
||||
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use Rector\DeadCode\ValueObject\VariableNodeUse;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeNestingScope\FlowOfControlLocator;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class NodeByTypeAndPositionCollector
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeNestingScope\FlowOfControlLocator
|
||||
*/
|
||||
private $flowOfControlLocator;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
public function __construct(FlowOfControlLocator $flowOfControlLocator, NodeNameResolver $nodeNameResolver)
|
||||
{
|
||||
$this->flowOfControlLocator = $flowOfControlLocator;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
}
|
||||
/**
|
||||
* @param Variable[] $assignedVariables
|
||||
* @param Variable[] $assignedVariablesUse
|
||||
* @return VariableNodeUse[]
|
||||
*/
|
||||
public function collectNodesByTypeAndPosition(array $assignedVariables, array $assignedVariablesUse, FunctionLike $functionLike) : array
|
||||
{
|
||||
$nodesByTypeAndPosition = [];
|
||||
foreach ($assignedVariables as $assignedVariable) {
|
||||
$startTokenPos = $assignedVariable->getStartTokenPos();
|
||||
// "-1" is empty value default
|
||||
if ($startTokenPos === -1) {
|
||||
continue;
|
||||
}
|
||||
// not in different scope, than previous one - e.g. if/while/else...
|
||||
// get nesting level to $classMethodNode
|
||||
/** @var Assign $assign */
|
||||
$assign = $assignedVariable->getAttribute(AttributeKey::PARENT_NODE);
|
||||
$nestingHash = $this->flowOfControlLocator->resolveNestingHashFromFunctionLike($functionLike, $assign);
|
||||
/** @var string $variableName */
|
||||
$variableName = $this->nodeNameResolver->getName($assignedVariable);
|
||||
$nodesByTypeAndPosition[] = new VariableNodeUse($startTokenPos, $variableName, VariableNodeUse::TYPE_ASSIGN, $assignedVariable, $nestingHash);
|
||||
}
|
||||
foreach ($assignedVariablesUse as $assignedVariableUse) {
|
||||
$startTokenPos = $assignedVariableUse->getStartTokenPos();
|
||||
// "-1" is empty value default
|
||||
if ($startTokenPos === -1) {
|
||||
continue;
|
||||
}
|
||||
/** @var string $variableName */
|
||||
$variableName = $this->nodeNameResolver->getName($assignedVariableUse);
|
||||
$nodesByTypeAndPosition[] = new VariableNodeUse($startTokenPos, $variableName, VariableNodeUse::TYPE_USE, $assignedVariableUse);
|
||||
}
|
||||
return $this->sortByStart($nodesByTypeAndPosition);
|
||||
}
|
||||
/**
|
||||
* @param VariableNodeUse[] $nodesByTypeAndPosition
|
||||
* @return VariableNodeUse[]
|
||||
*/
|
||||
private function sortByStart(array $nodesByTypeAndPosition) : array
|
||||
{
|
||||
\usort($nodesByTypeAndPosition, static function (VariableNodeUse $firstVariableNodeUse, VariableNodeUse $secondVariableNodeUse) : int {
|
||||
return $firstVariableNodeUse->getStartTokenPosition() <=> $secondVariableNodeUse->getStartTokenPosition();
|
||||
});
|
||||
return $nodesByTypeAndPosition;
|
||||
}
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\NodeFinder;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use Rector\Core\PhpParser\Comparing\NodeComparator;
|
||||
use Rector\Core\PhpParser\Node\BetterNodeFinder;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class VariableUseFinder
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
|
||||
*/
|
||||
private $betterNodeFinder;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\PhpParser\Comparing\NodeComparator
|
||||
*/
|
||||
private $nodeComparator;
|
||||
public function __construct(BetterNodeFinder $betterNodeFinder, NodeNameResolver $nodeNameResolver, NodeComparator $nodeComparator)
|
||||
{
|
||||
$this->betterNodeFinder = $betterNodeFinder;
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->nodeComparator = $nodeComparator;
|
||||
}
|
||||
/**
|
||||
* @param Variable[] $assignedVariables
|
||||
* @return Variable[]
|
||||
*/
|
||||
public function resolveUsedVariables(Node $node, array $assignedVariables) : array
|
||||
{
|
||||
return $this->betterNodeFinder->find($node, function (Node $node) use($assignedVariables) : bool {
|
||||
if (!$node instanceof Variable) {
|
||||
return \false;
|
||||
}
|
||||
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
|
||||
// is the left assign - not use of one
|
||||
if ($parentNode instanceof Assign && ($parentNode->var instanceof Variable && $parentNode->var === $node)) {
|
||||
return \false;
|
||||
}
|
||||
$nodeNameResolverGetName = $this->nodeNameResolver->getName($node);
|
||||
// simple variable only
|
||||
if ($nodeNameResolverGetName === null) {
|
||||
return \false;
|
||||
}
|
||||
return $this->nodeComparator->isNodeEqual($node, $assignedVariables);
|
||||
});
|
||||
}
|
||||
}
|
@ -1,228 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\Rector\FunctionLike;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use Rector\Core\Php\ReservedKeywordAnalyzer;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\DeadCode\NodeCollector\NodeByTypeAndPositionCollector;
|
||||
use Rector\DeadCode\NodeFinder\VariableUseFinder;
|
||||
use Rector\DeadCode\SideEffect\SideEffectNodeDetector;
|
||||
use Rector\DeadCode\ValueObject\VariableNodeUse;
|
||||
use Rector\NodeNestingScope\ContextAnalyzer;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @see \Rector\Tests\DeadCode\Rector\FunctionLike\RemoveOverriddenValuesRector\RemoveOverriddenValuesRectorTest
|
||||
*/
|
||||
final class RemoveOverriddenValuesRector extends AbstractRector
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\NodeNestingScope\ContextAnalyzer
|
||||
*/
|
||||
private $contextAnalyzer;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\DeadCode\NodeCollector\NodeByTypeAndPositionCollector
|
||||
*/
|
||||
private $nodeByTypeAndPositionCollector;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\DeadCode\NodeFinder\VariableUseFinder
|
||||
*/
|
||||
private $variableUseFinder;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Php\ReservedKeywordAnalyzer
|
||||
*/
|
||||
private $reservedKeywordAnalyzer;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\DeadCode\SideEffect\SideEffectNodeDetector
|
||||
*/
|
||||
private $sideEffectNodeDetector;
|
||||
public function __construct(ContextAnalyzer $contextAnalyzer, NodeByTypeAndPositionCollector $nodeByTypeAndPositionCollector, VariableUseFinder $variableUseFinder, ReservedKeywordAnalyzer $reservedKeywordAnalyzer, SideEffectNodeDetector $sideEffectNodeDetector)
|
||||
{
|
||||
$this->contextAnalyzer = $contextAnalyzer;
|
||||
$this->nodeByTypeAndPositionCollector = $nodeByTypeAndPositionCollector;
|
||||
$this->variableUseFinder = $variableUseFinder;
|
||||
$this->reservedKeywordAnalyzer = $reservedKeywordAnalyzer;
|
||||
$this->sideEffectNodeDetector = $sideEffectNodeDetector;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Remove initial assigns of overridden values', [new CodeSample(<<<'CODE_SAMPLE'
|
||||
final class SomeController
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$directories = [];
|
||||
$possibleDirectories = [];
|
||||
$directories = array_filter($possibleDirectories, 'file_exists');
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
final class SomeController
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$possibleDirectories = [];
|
||||
$directories = array_filter($possibleDirectories, 'file_exists');
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [FunctionLike::class];
|
||||
}
|
||||
/**
|
||||
* @param FunctionLike $node
|
||||
*/
|
||||
public function refactor(Node $node) : ?Node
|
||||
{
|
||||
// 1. collect assigns
|
||||
$assignedVariables = $this->resolveAssignedVariables($node);
|
||||
$assignedVariableNames = $this->getNodeNames($assignedVariables);
|
||||
// 2. collect use of those variables
|
||||
$assignedVariablesUse = $this->variableUseFinder->resolveUsedVariables($node, $assignedVariables);
|
||||
$nodesByTypeAndPosition = $this->nodeByTypeAndPositionCollector->collectNodesByTypeAndPosition($assignedVariables, $assignedVariablesUse, $node);
|
||||
$nodesToRemove = $this->resolveNodesToRemove($assignedVariableNames, $nodesByTypeAndPosition);
|
||||
if ($nodesToRemove === []) {
|
||||
return null;
|
||||
}
|
||||
$this->nodeRemover->removeNodes($nodesToRemove);
|
||||
return $node;
|
||||
}
|
||||
/**
|
||||
* @return Variable[]
|
||||
*/
|
||||
private function resolveAssignedVariables(FunctionLike $functionLike) : array
|
||||
{
|
||||
return $this->betterNodeFinder->find($functionLike, function (Node $node) use($functionLike) : bool {
|
||||
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if (!$parentNode instanceof Assign) {
|
||||
return \false;
|
||||
}
|
||||
if (!$node instanceof Variable) {
|
||||
return \false;
|
||||
}
|
||||
// skin in if
|
||||
if ($this->contextAnalyzer->isInIf($node)) {
|
||||
return \false;
|
||||
}
|
||||
// is variable on the left
|
||||
/** @var Assign $assignNode */
|
||||
$assignNode = $node->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if ($assignNode->var !== $node) {
|
||||
return \false;
|
||||
}
|
||||
if ($this->sideEffectNodeDetector->detectCallExpr($assignNode->expr)) {
|
||||
return \false;
|
||||
}
|
||||
// simple variable only
|
||||
if (!\is_string($node->name)) {
|
||||
return \false;
|
||||
}
|
||||
$parentFunctionLike = $this->betterNodeFinder->findParentType($node, FunctionLike::class);
|
||||
if ($parentFunctionLike !== $functionLike) {
|
||||
return \false;
|
||||
}
|
||||
return !$this->reservedKeywordAnalyzer->isNativeVariable($node->name);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @param Node[] $nodes
|
||||
* @return string[]
|
||||
*/
|
||||
private function getNodeNames(array $nodes) : array
|
||||
{
|
||||
$nodeNames = [];
|
||||
foreach ($nodes as $node) {
|
||||
$nodeName = $this->getName($node);
|
||||
if (\is_string($nodeName)) {
|
||||
$nodeNames[] = $nodeName;
|
||||
}
|
||||
}
|
||||
return \array_unique($nodeNames);
|
||||
}
|
||||
/**
|
||||
* @param string[] $assignedVariableNames
|
||||
* @param VariableNodeUse[] $nodesByTypeAndPosition
|
||||
* @return Node[]
|
||||
*/
|
||||
private function resolveNodesToRemove(array $assignedVariableNames, array $nodesByTypeAndPosition) : array
|
||||
{
|
||||
$nodesToRemove = [];
|
||||
foreach ($assignedVariableNames as $assignedVariableName) {
|
||||
$previousNode = null;
|
||||
foreach ($nodesByTypeAndPosition as $nodes) {
|
||||
$variableNode = $nodes->getVariableNode();
|
||||
$comments = $variableNode->getAttribute(AttributeKey::COMMENTS);
|
||||
if ($comments !== null) {
|
||||
continue;
|
||||
}
|
||||
$nodesIsName = $nodes->isName($assignedVariableName);
|
||||
if (!$nodesIsName) {
|
||||
continue;
|
||||
}
|
||||
if ($this->isAssignNodeUsed($previousNode, $nodes)) {
|
||||
// continue
|
||||
// instant override → remove
|
||||
} elseif ($this->shouldRemoveAssignNode($previousNode, $nodes)) {
|
||||
/** @var VariableNodeUse $previousNode */
|
||||
$nodesToRemove[] = $previousNode->getParentNode();
|
||||
}
|
||||
$previousNode = $nodes;
|
||||
}
|
||||
}
|
||||
return $nodesToRemove;
|
||||
}
|
||||
private function isAssignNodeUsed(?VariableNodeUse $previousNode, VariableNodeUse $nodeByTypeAndPosition) : bool
|
||||
{
|
||||
// this node was just used, skip to next one
|
||||
if (!$previousNode instanceof VariableNodeUse) {
|
||||
return \false;
|
||||
}
|
||||
if (!$previousNode->isType(VariableNodeUse::TYPE_ASSIGN)) {
|
||||
return \false;
|
||||
}
|
||||
return $nodeByTypeAndPosition->isType(VariableNodeUse::TYPE_USE);
|
||||
}
|
||||
private function shouldRemoveAssignNode(?VariableNodeUse $previousNode, VariableNodeUse $nodeByTypeAndPosition) : bool
|
||||
{
|
||||
if ($previousNode === null) {
|
||||
return \false;
|
||||
}
|
||||
if (!$previousNode->isType(VariableNodeUse::TYPE_ASSIGN)) {
|
||||
return \false;
|
||||
}
|
||||
if (!$nodeByTypeAndPosition->isType(VariableNodeUse::TYPE_ASSIGN)) {
|
||||
return \false;
|
||||
}
|
||||
// check the nesting level, e.g. call in if/while/else etc.
|
||||
if ($previousNode->getNestingHash() !== $nodeByTypeAndPosition->getNestingHash()) {
|
||||
return \false;
|
||||
}
|
||||
// check previous node doesn't contain the node on the right, e.g.
|
||||
// $someNode = 1;
|
||||
// $someNode = $someNode ?: 1;
|
||||
/** @var Assign $assignNode */
|
||||
$assignNode = $nodeByTypeAndPosition->getParentNode();
|
||||
$isVariableAssigned = (bool) $this->betterNodeFinder->findFirst($assignNode->expr, function (Node $node) use($nodeByTypeAndPosition) : bool {
|
||||
return $this->nodeComparator->areNodesEqual($node, $nodeByTypeAndPosition->getVariableNode());
|
||||
});
|
||||
return !$isVariableAssigned;
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\ValueObject;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\Validation\RectorAssert;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
final class VariableNodeUse
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const TYPE_USE = 'use';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const TYPE_ASSIGN = 'assign';
|
||||
/**
|
||||
* @readonly
|
||||
* @var int
|
||||
*/
|
||||
private $startTokenPosition;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $variableName;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $type;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \PhpParser\Node\Expr\Variable
|
||||
*/
|
||||
private $variable;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string|null
|
||||
*/
|
||||
private $nestingHash;
|
||||
public function __construct(int $startTokenPosition, string $variableName, string $type, Variable $variable, ?string $nestingHash = null)
|
||||
{
|
||||
$this->startTokenPosition = $startTokenPosition;
|
||||
$this->variableName = $variableName;
|
||||
$this->type = $type;
|
||||
$this->variable = $variable;
|
||||
$this->nestingHash = $nestingHash;
|
||||
RectorAssert::className($type);
|
||||
}
|
||||
public function isName(string $name) : bool
|
||||
{
|
||||
return $this->variableName === $name;
|
||||
}
|
||||
public function getStartTokenPosition() : int
|
||||
{
|
||||
return $this->startTokenPosition;
|
||||
}
|
||||
public function isType(string $type) : bool
|
||||
{
|
||||
return $this->type === $type;
|
||||
}
|
||||
public function getVariableNode() : Variable
|
||||
{
|
||||
return $this->variable;
|
||||
}
|
||||
public function getParentNode() : Node
|
||||
{
|
||||
$parentNode = $this->variable->getAttribute(AttributeKey::PARENT_NODE);
|
||||
if (!$parentNode instanceof Node) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
return $parentNode;
|
||||
}
|
||||
public function getNestingHash() : ?string
|
||||
{
|
||||
return $this->nestingHash;
|
||||
}
|
||||
}
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '5972ff7417911319f1ce754636937cd07af2a04c';
|
||||
public const PACKAGE_VERSION = 'f608461e44c6a4008a2bff6c603ba9d52d3ffacf';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-07-03 08:59:25';
|
||||
public const RELEASE_DATE = '2022-07-03 09:59:36';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
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 ComposerAutoloaderInit9f78686f83a3f168d1e9e492a018c1b4::getLoader();
|
||||
return ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872::getLoader();
|
||||
|
5
vendor/composer/autoload_classmap.php
vendored
5
vendor/composer/autoload_classmap.php
vendored
@ -1678,9 +1678,7 @@ return array(
|
||||
'Rector\\DeadCode\\NodeAnalyzer\\JustPropertyFetchVariableAssignMatcher' => $baseDir . '/rules/DeadCode/NodeAnalyzer/JustPropertyFetchVariableAssignMatcher.php',
|
||||
'Rector\\DeadCode\\NodeAnalyzer\\UsedVariableNameAnalyzer' => $baseDir . '/rules/DeadCode/NodeAnalyzer/UsedVariableNameAnalyzer.php',
|
||||
'Rector\\DeadCode\\NodeCollector\\ModifiedVariableNamesCollector' => $baseDir . '/rules/DeadCode/NodeCollector/ModifiedVariableNamesCollector.php',
|
||||
'Rector\\DeadCode\\NodeCollector\\NodeByTypeAndPositionCollector' => $baseDir . '/rules/DeadCode/NodeCollector/NodeByTypeAndPositionCollector.php',
|
||||
'Rector\\DeadCode\\NodeCollector\\UnusedParameterResolver' => $baseDir . '/rules/DeadCode/NodeCollector/UnusedParameterResolver.php',
|
||||
'Rector\\DeadCode\\NodeFinder\\VariableUseFinder' => $baseDir . '/rules/DeadCode/NodeFinder/VariableUseFinder.php',
|
||||
'Rector\\DeadCode\\NodeManipulator\\ControllerClassMethodManipulator' => $baseDir . '/rules/DeadCode/NodeManipulator/ControllerClassMethodManipulator.php',
|
||||
'Rector\\DeadCode\\NodeManipulator\\CountManipulator' => $baseDir . '/rules/DeadCode/NodeManipulator/CountManipulator.php',
|
||||
'Rector\\DeadCode\\NodeManipulator\\LivingCodeManipulator' => $baseDir . '/rules/DeadCode/NodeManipulator/LivingCodeManipulator.php',
|
||||
@ -1720,7 +1718,6 @@ return array(
|
||||
'Rector\\DeadCode\\Rector\\Foreach_\\RemoveUnusedForeachKeyRector' => $baseDir . '/rules/DeadCode/Rector/Foreach_/RemoveUnusedForeachKeyRector.php',
|
||||
'Rector\\DeadCode\\Rector\\FunctionLike\\RemoveDeadReturnRector' => $baseDir . '/rules/DeadCode/Rector/FunctionLike/RemoveDeadReturnRector.php',
|
||||
'Rector\\DeadCode\\Rector\\FunctionLike\\RemoveDuplicatedIfReturnRector' => $baseDir . '/rules/DeadCode/Rector/FunctionLike/RemoveDuplicatedIfReturnRector.php',
|
||||
'Rector\\DeadCode\\Rector\\FunctionLike\\RemoveOverriddenValuesRector' => $baseDir . '/rules/DeadCode/Rector/FunctionLike/RemoveOverriddenValuesRector.php',
|
||||
'Rector\\DeadCode\\Rector\\If_\\RemoveAlwaysTrueIfConditionRector' => $baseDir . '/rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php',
|
||||
'Rector\\DeadCode\\Rector\\If_\\RemoveDeadInstanceOfRector' => $baseDir . '/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php',
|
||||
'Rector\\DeadCode\\Rector\\If_\\RemoveUnusedNonEmptyArrayBeforeForeachRector' => $baseDir . '/rules/DeadCode/Rector/If_/RemoveUnusedNonEmptyArrayBeforeForeachRector.php',
|
||||
@ -1749,7 +1746,6 @@ return array(
|
||||
'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',
|
||||
'Rector\\Defluent\\NodeAnalyzer\\FluentChainMethodCallNodeAnalyzer' => $baseDir . '/packages/Defluent/NodeAnalyzer/FluentChainMethodCallNodeAnalyzer.php',
|
||||
'Rector\\Defluent\\NodeAnalyzer\\SameClassMethodCallAnalyzer' => $baseDir . '/packages/Defluent/NodeAnalyzer/SameClassMethodCallAnalyzer.php',
|
||||
@ -2223,7 +2219,6 @@ return array(
|
||||
'Rector\\NodeNameResolver\\NodeNameResolver\\VariableNameResolver' => $baseDir . '/packages/NodeNameResolver/NodeNameResolver/VariableNameResolver.php',
|
||||
'Rector\\NodeNameResolver\\Regex\\RegexPatternDetector' => $baseDir . '/packages/NodeNameResolver/Regex/RegexPatternDetector.php',
|
||||
'Rector\\NodeNestingScope\\ContextAnalyzer' => $baseDir . '/packages/NodeNestingScope/ContextAnalyzer.php',
|
||||
'Rector\\NodeNestingScope\\FlowOfControlLocator' => $baseDir . '/packages/NodeNestingScope/FlowOfControlLocator.php',
|
||||
'Rector\\NodeNestingScope\\NodeFinder\\ScopeAwareNodeFinder' => $baseDir . '/packages/NodeNestingScope/NodeFinder/ScopeAwareNodeFinder.php',
|
||||
'Rector\\NodeNestingScope\\ParentScopeFinder' => $baseDir . '/packages/NodeNestingScope/ParentScopeFinder.php',
|
||||
'Rector\\NodeNestingScope\\ScopeNestingComparator' => $baseDir . '/packages/NodeNestingScope/ScopeNestingComparator.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 ComposerAutoloaderInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
class ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9f78686f83a3f168d1e9e492a018c1b4', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9f78686f83a3f168d1e9e492a018c1b4', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit39c1e46a51a1dbf4e2612d6c7327c872', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire9f78686f83a3f168d1e9e492a018c1b4($fileIdentifier, $file);
|
||||
composerRequire39c1e46a51a1dbf4e2612d6c7327c872($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire9f78686f83a3f168d1e9e492a018c1b4($fileIdentifier, $file)
|
||||
function composerRequire39c1e46a51a1dbf4e2612d6c7327c872($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
13
vendor/composer/autoload_static.php
vendored
13
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
class ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
@ -1985,9 +1985,7 @@ class ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
'Rector\\DeadCode\\NodeAnalyzer\\JustPropertyFetchVariableAssignMatcher' => __DIR__ . '/../..' . '/rules/DeadCode/NodeAnalyzer/JustPropertyFetchVariableAssignMatcher.php',
|
||||
'Rector\\DeadCode\\NodeAnalyzer\\UsedVariableNameAnalyzer' => __DIR__ . '/../..' . '/rules/DeadCode/NodeAnalyzer/UsedVariableNameAnalyzer.php',
|
||||
'Rector\\DeadCode\\NodeCollector\\ModifiedVariableNamesCollector' => __DIR__ . '/../..' . '/rules/DeadCode/NodeCollector/ModifiedVariableNamesCollector.php',
|
||||
'Rector\\DeadCode\\NodeCollector\\NodeByTypeAndPositionCollector' => __DIR__ . '/../..' . '/rules/DeadCode/NodeCollector/NodeByTypeAndPositionCollector.php',
|
||||
'Rector\\DeadCode\\NodeCollector\\UnusedParameterResolver' => __DIR__ . '/../..' . '/rules/DeadCode/NodeCollector/UnusedParameterResolver.php',
|
||||
'Rector\\DeadCode\\NodeFinder\\VariableUseFinder' => __DIR__ . '/../..' . '/rules/DeadCode/NodeFinder/VariableUseFinder.php',
|
||||
'Rector\\DeadCode\\NodeManipulator\\ControllerClassMethodManipulator' => __DIR__ . '/../..' . '/rules/DeadCode/NodeManipulator/ControllerClassMethodManipulator.php',
|
||||
'Rector\\DeadCode\\NodeManipulator\\CountManipulator' => __DIR__ . '/../..' . '/rules/DeadCode/NodeManipulator/CountManipulator.php',
|
||||
'Rector\\DeadCode\\NodeManipulator\\LivingCodeManipulator' => __DIR__ . '/../..' . '/rules/DeadCode/NodeManipulator/LivingCodeManipulator.php',
|
||||
@ -2027,7 +2025,6 @@ class ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
'Rector\\DeadCode\\Rector\\Foreach_\\RemoveUnusedForeachKeyRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/Foreach_/RemoveUnusedForeachKeyRector.php',
|
||||
'Rector\\DeadCode\\Rector\\FunctionLike\\RemoveDeadReturnRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/FunctionLike/RemoveDeadReturnRector.php',
|
||||
'Rector\\DeadCode\\Rector\\FunctionLike\\RemoveDuplicatedIfReturnRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/FunctionLike/RemoveDuplicatedIfReturnRector.php',
|
||||
'Rector\\DeadCode\\Rector\\FunctionLike\\RemoveOverriddenValuesRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/FunctionLike/RemoveOverriddenValuesRector.php',
|
||||
'Rector\\DeadCode\\Rector\\If_\\RemoveAlwaysTrueIfConditionRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php',
|
||||
'Rector\\DeadCode\\Rector\\If_\\RemoveDeadInstanceOfRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/If_/RemoveDeadInstanceOfRector.php',
|
||||
'Rector\\DeadCode\\Rector\\If_\\RemoveUnusedNonEmptyArrayBeforeForeachRector' => __DIR__ . '/../..' . '/rules/DeadCode/Rector/If_/RemoveUnusedNonEmptyArrayBeforeForeachRector.php',
|
||||
@ -2056,7 +2053,6 @@ class ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
'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',
|
||||
'Rector\\Defluent\\NodeAnalyzer\\FluentChainMethodCallNodeAnalyzer' => __DIR__ . '/../..' . '/packages/Defluent/NodeAnalyzer/FluentChainMethodCallNodeAnalyzer.php',
|
||||
'Rector\\Defluent\\NodeAnalyzer\\SameClassMethodCallAnalyzer' => __DIR__ . '/../..' . '/packages/Defluent/NodeAnalyzer/SameClassMethodCallAnalyzer.php',
|
||||
@ -2530,7 +2526,6 @@ class ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
'Rector\\NodeNameResolver\\NodeNameResolver\\VariableNameResolver' => __DIR__ . '/../..' . '/packages/NodeNameResolver/NodeNameResolver/VariableNameResolver.php',
|
||||
'Rector\\NodeNameResolver\\Regex\\RegexPatternDetector' => __DIR__ . '/../..' . '/packages/NodeNameResolver/Regex/RegexPatternDetector.php',
|
||||
'Rector\\NodeNestingScope\\ContextAnalyzer' => __DIR__ . '/../..' . '/packages/NodeNestingScope/ContextAnalyzer.php',
|
||||
'Rector\\NodeNestingScope\\FlowOfControlLocator' => __DIR__ . '/../..' . '/packages/NodeNestingScope/FlowOfControlLocator.php',
|
||||
'Rector\\NodeNestingScope\\NodeFinder\\ScopeAwareNodeFinder' => __DIR__ . '/../..' . '/packages/NodeNestingScope/NodeFinder/ScopeAwareNodeFinder.php',
|
||||
'Rector\\NodeNestingScope\\ParentScopeFinder' => __DIR__ . '/../..' . '/packages/NodeNestingScope/ParentScopeFinder.php',
|
||||
'Rector\\NodeNestingScope\\ScopeNestingComparator' => __DIR__ . '/../..' . '/packages/NodeNestingScope/ScopeNestingComparator.php',
|
||||
@ -3419,9 +3414,9 @@ class ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9f78686f83a3f168d1e9e492a018c1b4::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit39c1e46a51a1dbf4e2612d6c7327c872::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user