Updated Rector to commit a2ee46d16e

a2ee46d16e Refactor SymplifyUselessVariableRector to avoid using PREVIOUS_NODE, use current scope instead (#2045)
This commit is contained in:
Tomas Votruba 2022-04-10 18:18:46 +00:00
parent a4e8d9fc7a
commit d76ed237fa
11 changed files with 118 additions and 79 deletions

View File

@ -43,6 +43,7 @@ use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector;
use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
use Rector\CodeQuality\Rector\FuncCall\UnwrapSprintfOneArgumentRector;
use Rector\CodeQuality\Rector\FunctionLike\RemoveAlwaysTrueConditionSetInConstructorRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector;
@ -66,7 +67,6 @@ use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector;
use Rector\CodeQuality\Rector\New_\NewStaticToNewSelfRector;
use Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector;
use Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector;
use Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\Switch_\SingularSwitchToIfRector;
use Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector;
use Rector\CodeQuality\Rector\Ternary\SimplifyDuplicatedTernaryRector;
@ -96,7 +96,7 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services->set(\Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector::class);
$services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector::class);
$services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class);
$services->set(\Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector::class);
$services->set(\Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class);
$services->set(\Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class);
$services->set(\Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector::class);
$services->set(\Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector::class);

View File

@ -3,7 +3,7 @@
declare (strict_types=1);
namespace RectorPrefix20220410;
use Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\DeadCode\Rector\Array_\RemoveDuplicatedArrayKeyRector;
use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
@ -73,7 +73,7 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services->set(\Rector\DeadCode\Rector\For_\RemoveDeadIfForeachForRector::class);
$services->set(\Rector\DeadCode\Rector\BooleanAnd\RemoveAndTrueRector::class);
$services->set(\Rector\DeadCode\Rector\Concat\RemoveConcatAutocastRector::class);
$services->set(\Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector::class);
$services->set(\Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class);
$services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector::class);
$services->set(\Rector\DeadCode\Rector\BinaryOp\RemoveDuplicatedInstanceOfRector::class);
$services->set(\Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector::class);

View File

@ -1496,7 +1496,7 @@ Simplify tautology ternary to value
Removes useless variable assigns
- class: [`Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector`](../rules/CodeQuality/Rector/Return_/SimplifyUselessVariableRector.php)
- class: [`Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector`](../rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php)
```diff
function () {

View File

@ -0,0 +1,28 @@
<?php
declare (strict_types=1);
namespace Rector\CodeQuality\NodeAnalyzer;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Stmt\Return_;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
final class ReturnAnalyzer
{
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
public function __construct(\Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
{
$this->betterNodeFinder = $betterNodeFinder;
}
public function hasByRefReturn(\PhpParser\Node\Stmt\Return_ $return) : bool
{
$parentFunctionLike = $this->betterNodeFinder->findParentType($return, \PhpParser\Node\FunctionLike::class);
if ($parentFunctionLike instanceof \PhpParser\Node\FunctionLike) {
return $parentFunctionLike->returnsByRef();
}
return \false;
}
}

View File

@ -1,17 +1,18 @@
<?php
declare (strict_types=1);
namespace Rector\CodeQuality\Rector\Return_;
namespace Rector\CodeQuality\Rector\FunctionLike;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\AssignOp;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Return_;
use PHPStan\Type\MixedType;
use Rector\CodeQuality\NodeAnalyzer\ReturnAnalyzer;
use Rector\Core\NodeAnalyzer\CallAnalyzer;
use Rector\Core\NodeAnalyzer\VariableAnalyzer;
use Rector\Core\PhpParser\Node\AssignAndBinaryMap;
@ -21,7 +22,7 @@ use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see Based on https://github.com/slevomat/coding-standard/blob/master/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php
* @see \Rector\Tests\CodeQuality\Rector\Return_\SimplifyUselessVariableRector\SimplifyUselessVariableRectorTest
* @see \Rector\Tests\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector\SimplifyUselessVariableRectorTest
*/
final class SimplifyUselessVariableRector extends \Rector\Core\Rector\AbstractRector
{
@ -40,11 +41,17 @@ final class SimplifyUselessVariableRector extends \Rector\Core\Rector\AbstractRe
* @var \Rector\Core\NodeAnalyzer\CallAnalyzer
*/
private $callAnalyzer;
public function __construct(\Rector\Core\PhpParser\Node\AssignAndBinaryMap $assignAndBinaryMap, \Rector\Core\NodeAnalyzer\VariableAnalyzer $variableAnalyzer, \Rector\Core\NodeAnalyzer\CallAnalyzer $callAnalyzer)
/**
* @readonly
* @var \Rector\CodeQuality\NodeAnalyzer\ReturnAnalyzer
*/
private $returnAnalyzer;
public function __construct(\Rector\Core\PhpParser\Node\AssignAndBinaryMap $assignAndBinaryMap, \Rector\Core\NodeAnalyzer\VariableAnalyzer $variableAnalyzer, \Rector\Core\NodeAnalyzer\CallAnalyzer $callAnalyzer, \Rector\CodeQuality\NodeAnalyzer\ReturnAnalyzer $returnAnalyzer)
{
$this->assignAndBinaryMap = $assignAndBinaryMap;
$this->variableAnalyzer = $variableAnalyzer;
$this->callAnalyzer = $callAnalyzer;
$this->returnAnalyzer = $returnAnalyzer;
}
public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
{
@ -66,93 +73,95 @@ CODE_SAMPLE
*/
public function getNodeTypes() : array
{
return [\PhpParser\Node\Stmt\Return_::class];
return [\PhpParser\Node\FunctionLike::class];
}
/**
* @param Return_ $node
* @param FunctionLike $node
*/
public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
{
if ($this->shouldSkip($node)) {
$stmts = $node->getStmts();
if ($stmts === null) {
return null;
}
/** @var Expression $previousExpression */
$previousExpression = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PREVIOUS_NODE);
/** @var Assign|AssignOp $previousNode */
$previousNode = $previousExpression->expr;
$previousVariableNode = $previousNode->var;
if ($this->hasSomeComment($previousVariableNode)) {
return null;
}
if ($previousNode instanceof \PhpParser\Node\Expr\Assign) {
if ($this->isReturnWithVarAnnotation($node)) {
return null;
$previousStmt = null;
$hasChanged = \false;
foreach ($stmts as $stmt) {
if ($previousStmt === null || !$stmt instanceof \PhpParser\Node\Stmt\Return_) {
$previousStmt = $stmt;
continue;
}
$node->expr = $previousNode->expr;
}
if ($previousNode instanceof \PhpParser\Node\Expr\AssignOp) {
$binaryClass = $this->assignAndBinaryMap->getAlternative($previousNode);
if ($binaryClass === null) {
return null;
if ($this->shouldSkipStmt($stmt, $previousStmt)) {
$previousStmt = $stmt;
continue;
}
$node->expr = new $binaryClass($previousNode->var, $previousNode->expr);
/** @var Expression $previousStmt */
/** @var Assign|AssignOp $previousNode */
$previousNode = $previousStmt->expr;
/** @var Return_ $stmt */
if ($previousNode instanceof \PhpParser\Node\Expr\Assign) {
if ($this->isReturnWithVarAnnotation($stmt)) {
continue;
}
$stmt->expr = $previousNode->expr;
} else {
$binaryClass = $this->assignAndBinaryMap->getAlternative($previousNode);
if ($binaryClass === null) {
continue;
}
$stmt->expr = new $binaryClass($previousNode->var, $previousNode->expr);
}
$this->removeNode($previousStmt);
$hasChanged = \true;
$previousStmt = $stmt;
}
$this->removeNode($previousNode);
return $node;
if ($hasChanged) {
return $node;
}
return null;
}
private function hasByRefReturn(\PhpParser\Node\Stmt\Return_ $return) : bool
private function shouldSkipStmt(\PhpParser\Node\Stmt\Return_ $return, \PhpParser\Node\Stmt $previousStmt) : bool
{
$node = $return;
while ($node = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE)) {
if ($node instanceof \PhpParser\Node\FunctionLike) {
return $node->returnsByRef();
}
if (!$node instanceof \PhpParser\Node) {
break;
}
if ($this->hasSomeComment($previousStmt)) {
return \true;
}
return \false;
}
private function shouldSkip(\PhpParser\Node\Stmt\Return_ $return) : bool
{
if (!$return->expr instanceof \PhpParser\Node\Expr\Variable) {
return \true;
}
if ($this->hasByRefReturn($return)) {
if ($this->returnAnalyzer->hasByRefReturn($return)) {
return \true;
}
/** @var Variable $variableNode */
$variableNode = $return->expr;
$previousExpression = $return->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PREVIOUS_NODE);
if (!$previousExpression instanceof \PhpParser\Node\Stmt\Expression) {
/** @var Variable $variable */
$variable = $return->expr;
if (!$previousStmt instanceof \PhpParser\Node\Stmt\Expression) {
return \true;
}
// is variable part of single assign
$previousNode = $previousExpression->expr;
$previousNode = $previousStmt->expr;
if (!$previousNode instanceof \PhpParser\Node\Expr\AssignOp && !$previousNode instanceof \PhpParser\Node\Expr\Assign) {
return \true;
}
// is the same variable
if (!$this->nodeComparator->areNodesEqual($previousNode->var, $variableNode)) {
if (!$this->nodeComparator->areNodesEqual($previousNode->var, $variable)) {
return \true;
}
if ($this->isPreviousExpressionVisuallySimilar($previousExpression, $previousNode)) {
if ($this->isPreviousExpressionVisuallySimilar($previousStmt, $previousNode)) {
return \true;
}
if ($this->variableAnalyzer->isStaticOrGlobal($variableNode)) {
if ($this->variableAnalyzer->isStaticOrGlobal($variable)) {
return \true;
}
if ($this->callAnalyzer->isNewInstance($previousNode->var)) {
return \true;
}
return $this->variableAnalyzer->isUsedByReference($variableNode);
return $this->variableAnalyzer->isUsedByReference($variable);
}
private function hasSomeComment(\PhpParser\Node\Expr $expr) : bool
private function hasSomeComment(\PhpParser\Node\Stmt $stmt) : bool
{
if ($expr->getComments() !== []) {
if ($stmt->getComments() !== []) {
return \true;
}
return $expr->getDocComment() !== null;
return $stmt->getDocComment() !== null;
}
private function isReturnWithVarAnnotation(\PhpParser\Node\Stmt\Return_ $return) : bool
{

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'b9a912bb5d5c4966d2a7893aa3d12abe96a1ccfa';
public const PACKAGE_VERSION = 'a2ee46d16e7f0a01c7aae31eef659d7456528dcc';
/**
* @var string
*/
public const RELEASE_DATE = '2022-04-10 19:36:55';
public const RELEASE_DATE = '2022-04-10 20:12:34';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220410\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

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

View File

@ -1467,6 +1467,7 @@ return array(
'Rector\\CodeQuality\\NodeAnalyzer\\ForAnalyzer' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ForAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ForeachAnalyzer' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ForeachAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\LocalPropertyAnalyzer' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/LocalPropertyAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ReturnAnalyzer' => $baseDir . '/rules/CodeQuality/NodeAnalyzer/ReturnAnalyzer.php',
'Rector\\CodeQuality\\NodeFactory\\ArrayFilterFactory' => $baseDir . '/rules/CodeQuality/NodeFactory/ArrayFilterFactory.php',
'Rector\\CodeQuality\\NodeFactory\\ForeachFactory' => $baseDir . '/rules/CodeQuality/NodeFactory/ForeachFactory.php',
'Rector\\CodeQuality\\NodeFactory\\MissingPropertiesFactory' => $baseDir . '/rules/CodeQuality/NodeFactory/MissingPropertiesFactory.php',
@ -1516,6 +1517,7 @@ return array(
'Rector\\CodeQuality\\Rector\\FuncCall\\SingleInArrayToCompareRector' => $baseDir . '/rules/CodeQuality/Rector/FuncCall/SingleInArrayToCompareRector.php',
'Rector\\CodeQuality\\Rector\\FuncCall\\UnwrapSprintfOneArgumentRector' => $baseDir . '/rules/CodeQuality/Rector/FuncCall/UnwrapSprintfOneArgumentRector.php',
'Rector\\CodeQuality\\Rector\\FunctionLike\\RemoveAlwaysTrueConditionSetInConstructorRector' => $baseDir . '/rules/CodeQuality/Rector/FunctionLike/RemoveAlwaysTrueConditionSetInConstructorRector.php',
'Rector\\CodeQuality\\Rector\\FunctionLike\\SimplifyUselessVariableRector' => $baseDir . '/rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php',
'Rector\\CodeQuality\\Rector\\Identical\\BooleanNotIdenticalToNotIdenticalRector' => $baseDir . '/rules/CodeQuality/Rector/Identical/BooleanNotIdenticalToNotIdenticalRector.php',
'Rector\\CodeQuality\\Rector\\Identical\\FlipTypeControlToUseExclusiveTypeRector' => $baseDir . '/rules/CodeQuality/Rector/Identical/FlipTypeControlToUseExclusiveTypeRector.php',
'Rector\\CodeQuality\\Rector\\Identical\\GetClassToInstanceOfRector' => $baseDir . '/rules/CodeQuality/Rector/Identical/GetClassToInstanceOfRector.php',
@ -1539,7 +1541,6 @@ return array(
'Rector\\CodeQuality\\Rector\\New_\\NewStaticToNewSelfRector' => $baseDir . '/rules/CodeQuality/Rector/New_/NewStaticToNewSelfRector.php',
'Rector\\CodeQuality\\Rector\\NotEqual\\CommonNotEqualRector' => $baseDir . '/rules/CodeQuality/Rector/NotEqual/CommonNotEqualRector.php',
'Rector\\CodeQuality\\Rector\\PropertyFetch\\ExplicitMethodCallOverMagicGetSetRector' => $baseDir . '/rules/CodeQuality/Rector/PropertyFetch/ExplicitMethodCallOverMagicGetSetRector.php',
'Rector\\CodeQuality\\Rector\\Return_\\SimplifyUselessVariableRector' => $baseDir . '/rules/CodeQuality/Rector/Return_/SimplifyUselessVariableRector.php',
'Rector\\CodeQuality\\Rector\\Switch_\\SingularSwitchToIfRector' => $baseDir . '/rules/CodeQuality/Rector/Switch_/SingularSwitchToIfRector.php',
'Rector\\CodeQuality\\Rector\\Ternary\\ArrayKeyExistsTernaryThenValueToCoalescingRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/ArrayKeyExistsTernaryThenValueToCoalescingRector.php',
'Rector\\CodeQuality\\Rector\\Ternary\\SimplifyDuplicatedTernaryRector' => $baseDir . '/rules/CodeQuality/Rector/Ternary/SimplifyDuplicatedTernaryRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04
class ComposerAutoloaderInit73e6fc3983761eda226122cce054a877
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit73e6fc3983761eda226122cce054a877', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit73e6fc3983761eda226122cce054a877', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit73e6fc3983761eda226122cce054a877::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit73e6fc3983761eda226122cce054a877::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire5fde1ba4078f2b9e85edfecc2f522e04($fileIdentifier, $file);
composerRequire73e6fc3983761eda226122cce054a877($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04
* @param string $file
* @return void
*/
function composerRequire5fde1ba4078f2b9e85edfecc2f522e04($fileIdentifier, $file)
function composerRequire73e6fc3983761eda226122cce054a877($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04
class ComposerStaticInit73e6fc3983761eda226122cce054a877
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -1836,6 +1836,7 @@ class ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04
'Rector\\CodeQuality\\NodeAnalyzer\\ForAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ForAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ForeachAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ForeachAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\LocalPropertyAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/LocalPropertyAnalyzer.php',
'Rector\\CodeQuality\\NodeAnalyzer\\ReturnAnalyzer' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeAnalyzer/ReturnAnalyzer.php',
'Rector\\CodeQuality\\NodeFactory\\ArrayFilterFactory' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeFactory/ArrayFilterFactory.php',
'Rector\\CodeQuality\\NodeFactory\\ForeachFactory' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeFactory/ForeachFactory.php',
'Rector\\CodeQuality\\NodeFactory\\MissingPropertiesFactory' => __DIR__ . '/../..' . '/rules/CodeQuality/NodeFactory/MissingPropertiesFactory.php',
@ -1885,6 +1886,7 @@ class ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04
'Rector\\CodeQuality\\Rector\\FuncCall\\SingleInArrayToCompareRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/FuncCall/SingleInArrayToCompareRector.php',
'Rector\\CodeQuality\\Rector\\FuncCall\\UnwrapSprintfOneArgumentRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/FuncCall/UnwrapSprintfOneArgumentRector.php',
'Rector\\CodeQuality\\Rector\\FunctionLike\\RemoveAlwaysTrueConditionSetInConstructorRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/FunctionLike/RemoveAlwaysTrueConditionSetInConstructorRector.php',
'Rector\\CodeQuality\\Rector\\FunctionLike\\SimplifyUselessVariableRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/FunctionLike/SimplifyUselessVariableRector.php',
'Rector\\CodeQuality\\Rector\\Identical\\BooleanNotIdenticalToNotIdenticalRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Identical/BooleanNotIdenticalToNotIdenticalRector.php',
'Rector\\CodeQuality\\Rector\\Identical\\FlipTypeControlToUseExclusiveTypeRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Identical/FlipTypeControlToUseExclusiveTypeRector.php',
'Rector\\CodeQuality\\Rector\\Identical\\GetClassToInstanceOfRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Identical/GetClassToInstanceOfRector.php',
@ -1908,7 +1910,6 @@ class ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04
'Rector\\CodeQuality\\Rector\\New_\\NewStaticToNewSelfRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/New_/NewStaticToNewSelfRector.php',
'Rector\\CodeQuality\\Rector\\NotEqual\\CommonNotEqualRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/NotEqual/CommonNotEqualRector.php',
'Rector\\CodeQuality\\Rector\\PropertyFetch\\ExplicitMethodCallOverMagicGetSetRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/PropertyFetch/ExplicitMethodCallOverMagicGetSetRector.php',
'Rector\\CodeQuality\\Rector\\Return_\\SimplifyUselessVariableRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Return_/SimplifyUselessVariableRector.php',
'Rector\\CodeQuality\\Rector\\Switch_\\SingularSwitchToIfRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Switch_/SingularSwitchToIfRector.php',
'Rector\\CodeQuality\\Rector\\Ternary\\ArrayKeyExistsTernaryThenValueToCoalescingRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/ArrayKeyExistsTernaryThenValueToCoalescingRector.php',
'Rector\\CodeQuality\\Rector\\Ternary\\SimplifyDuplicatedTernaryRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Ternary/SimplifyDuplicatedTernaryRector.php',
@ -3858,9 +3859,9 @@ class ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit73e6fc3983761eda226122cce054a877::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit73e6fc3983761eda226122cce054a877::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit73e6fc3983761eda226122cce054a877::$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('RectorPrefix20220410\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', false) && !interface_exists('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', false) && !trait_exists('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', false)) {
spl_autoload_call('RectorPrefix20220410\ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04');
if (!class_exists('ComposerAutoloaderInit73e6fc3983761eda226122cce054a877', false) && !interface_exists('ComposerAutoloaderInit73e6fc3983761eda226122cce054a877', false) && !trait_exists('ComposerAutoloaderInit73e6fc3983761eda226122cce054a877', false)) {
spl_autoload_call('RectorPrefix20220410\ComposerAutoloaderInit73e6fc3983761eda226122cce054a877');
}
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('RectorPrefix20220410\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220410\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire5fde1ba4078f2b9e85edfecc2f522e04')) {
function composerRequire5fde1ba4078f2b9e85edfecc2f522e04() {
return \RectorPrefix20220410\composerRequire5fde1ba4078f2b9e85edfecc2f522e04(...func_get_args());
if (!function_exists('composerRequire73e6fc3983761eda226122cce054a877')) {
function composerRequire73e6fc3983761eda226122cce054a877() {
return \RectorPrefix20220410\composerRequire73e6fc3983761eda226122cce054a877(...func_get_args());
}
}
if (!function_exists('scanPath')) {