Updated Rector to commit 824df97e93bb43baca8f22a6f6a0f537a0049dd6

824df97e93 [DX] Move from CLASS_METHOD node attribute to parent finder (#1167)
This commit is contained in:
Tomas Votruba 2021-11-06 14:25:01 +00:00
parent a42ac7439f
commit b5ad3a2e08
37 changed files with 121 additions and 99 deletions

View File

@ -34,7 +34,7 @@ final class AttributeKey
public const CLASS_NAME = 'className';
/**
* @deprecated Use
* @see BetterNodeFinder to find your parent nodes.
* @see BetterNodeFinder::findParentType($node, ClassLike::class) to find your parent nodes.
*
* @var string
*/
@ -44,6 +44,9 @@ final class AttributeKey
*/
public const METHOD_NAME = 'methodName';
/**
* @deprecated Use
* @see BetterNodeFinder::findParentType($node, ClassMethod::class) to find your parent nodes.
*
* @var string
*/
public const METHOD_NODE = 'methodNode';

View File

@ -15,6 +15,7 @@ use PHPStan\Type\Type;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
use Rector\NodeTypeResolver\Node\AttributeKey;
@ -47,11 +48,16 @@ final class ParamTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeT
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
*/
private $phpDocInfoFactory;
public function __construct(\RectorPrefix20211106\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory $phpDocInfoFactory)
/**
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
public function __construct(\RectorPrefix20211106\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory $phpDocInfoFactory, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
{
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->nodeNameResolver = $nodeNameResolver;
$this->phpDocInfoFactory = $phpDocInfoFactory;
$this->betterNodeFinder = $betterNodeFinder;
}
/**
* @required
@ -95,7 +101,7 @@ final class ParamTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeT
}
private function resolveFromFirstVariableUse(\PhpParser\Node\Param $param) : \PHPStan\Type\Type
{
$classMethod = $param->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($param, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return new \PHPStan\Type\MixedType();
}

View File

@ -18,10 +18,6 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
*/
final class VariableTypeResolver implements \Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface
{
/**
* @var string[]
*/
private const PARENT_NODE_ATTRIBUTES = [\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE, \Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE];
/**
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
@ -73,26 +69,18 @@ final class VariableTypeResolver implements \Rector\NodeTypeResolver\Contract\No
}
private function resolveNodeScope(\PhpParser\Node\Expr\Variable $variable) : ?\PHPStan\Analyser\Scope
{
/** @var Scope|null $nodeScope */
$nodeScope = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if ($nodeScope !== null) {
return $nodeScope;
$scope = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if ($scope instanceof \PHPStan\Analyser\Scope) {
return $scope;
}
return $this->resolveFromParentNodes($variable);
}
private function resolveFromParentNodes(\PhpParser\Node\Expr\Variable $variable) : ?\PHPStan\Analyser\Scope
{
foreach (self::PARENT_NODE_ATTRIBUTES as $parentNodeAttribute) {
$parentNode = $variable->getAttribute($parentNodeAttribute);
if (!$parentNode instanceof \PhpParser\Node) {
continue;
}
$parentNodeScope = $parentNode->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
if (!$parentNodeScope instanceof \PHPStan\Analyser\Scope) {
continue;
}
return $parentNodeScope;
$parent = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE);
if (!$parent instanceof \PhpParser\Node) {
return null;
}
return null;
return $parent->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::SCOPE);
}
}

View File

@ -10,6 +10,7 @@ use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Expr\Ternary;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
use Rector\Core\Rector\AbstractRector;
use Rector\DeadCode\SideEffect\SideEffectNodeDetector;
@ -108,6 +109,8 @@ CODE_SAMPLE
}
private function areInSameClassMethod(\PhpParser\Node\Expr\Assign $assign, \PhpParser\Node\Stmt\Expression $previousExpression) : bool
{
return $this->nodeComparator->areNodesEqual($assign->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE), $previousExpression->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE));
$assignClassMethod = $this->betterNodeFinder->findParentType($assign, \PhpParser\Node\Stmt\ClassMethod::class);
$previousExpressionClassMethod = $this->betterNodeFinder->findParentType($previousExpression, \PhpParser\Node\Stmt\ClassMethod::class);
return $this->nodeComparator->areNodesEqual($assignClassMethod, $previousExpressionClassMethod);
}
}

View File

@ -13,6 +13,7 @@ use PhpParser\Node\Expr\NullsafeMethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\If_;
use Rector\Core\Php\ReservedKeywordAnalyzer;
@ -118,7 +119,7 @@ CODE_SAMPLE
}
private function shouldSkip(\PhpParser\Node\Expr\Assign $assign) : bool
{
$classMethod = $assign->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($assign, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\FunctionLike) {
return \true;
}

View File

@ -90,7 +90,7 @@ CODE_SAMPLE
$this->removeNode($node);
return null;
}
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return null;
}

View File

@ -5,9 +5,18 @@ namespace Rector\DependencyInjection\NodeAnalyzer;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Stmt\ClassMethod;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\NodeTypeResolver\Node\AttributeKey;
final class ControllerClassMethodAnalyzer
{
/**
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
public function __construct(\Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
{
$this->betterNodeFinder = $betterNodeFinder;
}
public function isInControllerActionMethod(\PhpParser\Node\Expr\Variable $variable) : bool
{
/** @var string|null $className */
@ -18,7 +27,7 @@ final class ControllerClassMethodAnalyzer
if (\substr_compare($className, 'Controller', -\strlen('Controller')) !== 0) {
return \false;
}
$classMethod = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($variable, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}

View File

@ -13,6 +13,7 @@ use PhpParser\Node\Stmt\Property;
use PHPStan\Type\MixedType;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\NodeManipulator\ClassInsertManipulator;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\MethodName;
@ -184,8 +185,11 @@ CODE_SAMPLE
}
private function decoratePropertyWithParamDocInfo(\PhpParser\Node\Param $param, \PhpParser\Node\Stmt\Property $property) : void
{
$constructor = $param->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($constructor);
$constructorClassMethod = $this->betterNodeFinder->findParentType($param, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$constructorClassMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
throw new \Rector\Core\Exception\ShouldNotHappenException();
}
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($constructorClassMethod);
if (!$phpDocInfo instanceof \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo) {
return;
}

View File

@ -9,6 +9,7 @@ use PhpParser\Node\Param;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use RectorPrefix20211106\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser;
@ -34,10 +35,15 @@ final class PhpSpecMockCollector
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
public function __construct(\RectorPrefix20211106\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver)
/**
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
public function __construct(\RectorPrefix20211106\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser $simpleCallableNodeTraverser, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
{
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->nodeNameResolver = $nodeNameResolver;
$this->betterNodeFinder = $betterNodeFinder;
}
/**
* @return mixed[]
@ -88,7 +94,7 @@ final class PhpSpecMockCollector
$variable = $this->nodeNameResolver->getName($param->var);
/** @var string $class */
$class = $param->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CLASS_NAME);
$classMethod = $param->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($param, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
throw new \Rector\Core\Exception\ShouldNotHappenException();
}

View File

@ -119,7 +119,7 @@ final class PhpSpecMocksToPHPUnitMocksRector extends \Rector\PhpSpecToPHPUnit\Re
$classLike = $this->betterNodeFinder->findParentType($param, \PhpParser\Node\Stmt\Class_::class);
$classMocks = $this->phpSpecMockCollector->resolveClassMocksFromParam($classLike);
$variable = $this->getName($param->var);
$classMethod = $param->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($param, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
throw new \Rector\Core\Exception\ShouldNotHappenException();
}

View File

@ -101,7 +101,7 @@ CODE_SAMPLE
return null;
}
foreach ($readOnlyVariableAssigns as $readOnlyVariableAssign) {
$classMethod = $readOnlyVariableAssign->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($readOnlyVariableAssign, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
throw new \Rector\Core\Exception\ShouldNotHappenException();
}

View File

@ -99,7 +99,7 @@ final class ComplexNodeRemover
*/
private function shouldSkipPropertyForClassMethod($expr, array $classMethodNamesToSkip) : bool
{
$classMethodNode = $expr->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethodNode = $this->betterNodeFinder->findParentType($expr, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethodNode instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}
@ -122,7 +122,7 @@ final class ComplexNodeRemover
}
private function removeConstructorDependency(\PhpParser\Node\Expr\Assign $assign) : void
{
$classMethod = $assign->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($assign, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return;
}

View File

@ -118,7 +118,7 @@ CODE_SAMPLE
}
private function isInStaticClassMethod(\PhpParser\Node\Expr\StaticCall $staticCall) : bool
{
$locationClassMethod = $staticCall->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$locationClassMethod = $this->betterNodeFinder->findParentType($staticCall, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$locationClassMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}

View File

@ -8,12 +8,12 @@ use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\Type\ObjectType;
use Rector\Core\Configuration\Option;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\MethodName;
use Rector\Naming\Naming\PropertyNaming;
use Rector\NodeTypeResolver\Node\AttributeKey;
use RectorPrefix20211106\Symplify\PackageBuilder\Parameter\ParameterProvider;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -82,7 +82,10 @@ CODE_SAMPLE
return $this->createFromSelf($node);
}
$propertyName = $this->propertyNaming->fqnToVariableName($staticObjectType);
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return null;
}
if ($this->nodeNameResolver->isName($classMethod, \Rector\Core\ValueObject\MethodName::CONSTRUCT)) {
$propertyFetch = new \PhpParser\Node\Expr\Variable($propertyName);
} else {

View File

@ -15,7 +15,6 @@ use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\Rector\AbstractRector;
use Rector\Naming\Naming\PropertyNaming;
use Rector\Naming\ValueObject\ExpectedName;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\TypeAnalyzer\ArrayTypeAnalyzer;
use Rector\PostRector\Collector\PropertyToAddCollector;
use Rector\PostRector\ValueObject\PropertyMetadata;
@ -143,10 +142,9 @@ CODE_SAMPLE
}
private function shouldSkipFuncCall(\PhpParser\Node\Expr\FuncCall $funcCall) : bool
{
// we can inject only in injectable class method context
// we can inject only in injectable class method context
/** @var ClassMethod|null $classMethod */
$classMethod = $funcCall->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($funcCall, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \true;
}

View File

@ -9,7 +9,6 @@ use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Transform\NodeAnalyzer\FuncCallStaticCallToMethodCallAnalyzer;
use Rector\Transform\ValueObject\FuncCallToMethodCall;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
@ -84,7 +83,7 @@ CODE_SAMPLE
if (!$classLike instanceof \PhpParser\Node\Stmt\Class_) {
return null;
}
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return null;
}

View File

@ -13,7 +13,6 @@ use PhpParser\Node\Stmt\ClassMethod;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Transform\NodeAnalyzer\FuncCallStaticCallToMethodCallAnalyzer;
use Rector\Transform\ValueObject\StaticCallToMethodCall;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
@ -93,7 +92,7 @@ CODE_SAMPLE
if (!$classLike instanceof \PhpParser\Node\Stmt\Class_) {
return null;
}
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return null;
}

View File

@ -85,7 +85,7 @@ final class GetterNodeParamTypeInferer implements \Rector\TypeDeclaration\Contra
return null;
}
// what is return type?
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return null;
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'c3b6efea7ee5351ce66461fe02c5f9b7282816bb';
public const PACKAGE_VERSION = '824df97e93bb43baca8f22a6f6a0f537a0049dd6';
/**
* @var string
*/
public const RELEASE_DATE = '2021-11-06 12:52:18';
public const RELEASE_DATE = '2021-11-06 15:07:22';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20211106\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

View File

@ -116,12 +116,12 @@ final class ClassMethodManipulator
*/
public function addMethodParameterIfMissing(\PhpParser\Node $node, \PHPStan\Type\ObjectType $objectType, array $possibleNames) : string
{
$classMethodNode = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
if (!$classMethodNode instanceof \PhpParser\Node\Stmt\ClassMethod) {
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
// or null?
throw new \Rector\Core\Exception\ShouldNotHappenException();
}
foreach ($classMethodNode->params as $paramNode) {
foreach ($classMethod->params as $paramNode) {
if (!$this->nodeTypeResolver->isObjectType($paramNode, $objectType)) {
continue;
}
@ -131,8 +131,8 @@ final class ClassMethodManipulator
}
return $paramName;
}
$paramName = $this->resolveName($classMethodNode, $possibleNames);
$classMethodNode->params[] = new \PhpParser\Node\Param(new \PhpParser\Node\Expr\Variable($paramName), null, new \PhpParser\Node\Name\FullyQualified($objectType->getClassName()));
$paramName = $this->resolveName($classMethod, $possibleNames);
$classMethod->params[] = new \PhpParser\Node\Param(new \PhpParser\Node\Expr\Variable($paramName), null, new \PhpParser\Node\Name\FullyQualified($objectType->getClassName()));
return $paramName;
}
public function isPropertyPromotion(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool

View File

@ -95,7 +95,7 @@ final class MethodCallManipulator
public function findMethodCallsOnVariable(\PhpParser\Node\Expr\Variable $variable) : array
{
// get scope node, e.g. parent function call, method call or anonymous function
$classMethod = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($variable, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return [];
}

View File

@ -125,7 +125,7 @@ final class PropertyManipulator
return \true;
}
// skip for constructor? it is allowed to set value in constructor method
$classMethod = $propertyFetch->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($propertyFetch, \PhpParser\Node\Stmt\ClassMethod::class);
if ($classMethod instanceof \PhpParser\Node\Stmt\ClassMethod && $this->nodeNameResolver->isName($classMethod->name, \Rector\Core\ValueObject\MethodName::CONSTRUCT)) {
continue;
}

View File

@ -20,7 +20,6 @@ use Rector\Core\PhpParser\Comparing\NodeComparator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\PhpParser\NodeFinder\LocalConstantFinder;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\NodeTypeResolver;
final class RegexPatternArgumentManipulator
{
@ -144,7 +143,7 @@ final class RegexPatternArgumentManipulator
*/
private function findAssignerForVariable(\PhpParser\Node\Expr\Variable $variable) : array
{
$classMethod = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($variable, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return [];
}

View File

@ -59,7 +59,7 @@ abstract class AbstractRector extends \PhpParser\NodeVisitorAbstract implements
/**
* @var string[]
*/
private const ATTRIBUTES_TO_MIRROR = [\Rector\NodeTypeResolver\Node\AttributeKey::CLASS_NAME, \Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE, \Rector\NodeTypeResolver\Node\AttributeKey::USE_NODES, \Rector\NodeTypeResolver\Node\AttributeKey::SCOPE, \Rector\NodeTypeResolver\Node\AttributeKey::RESOLVED_NAME, \Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE, \Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT, \Rector\NodeTypeResolver\Node\AttributeKey::PREVIOUS_STATEMENT];
private const ATTRIBUTES_TO_MIRROR = [\Rector\NodeTypeResolver\Node\AttributeKey::CLASS_NAME, \Rector\NodeTypeResolver\Node\AttributeKey::USE_NODES, \Rector\NodeTypeResolver\Node\AttributeKey::SCOPE, \Rector\NodeTypeResolver\Node\AttributeKey::RESOLVED_NAME, \Rector\NodeTypeResolver\Node\AttributeKey::PARENT_NODE, \Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT, \Rector\NodeTypeResolver\Node\AttributeKey::PREVIOUS_STATEMENT];
/**
* @var \Rector\NodeNameResolver\NodeNameResolver
*/

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit459af300f88369828b2c5381ea17dddb::getLoader();
return ComposerAutoloaderInit7ade9639c4b2634a59b028a99a4c8a81::getLoader();

View File

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

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit459af300f88369828b2c5381ea17dddb
class ComposerStaticInit7ade9639c4b2634a59b028a99a4c8a81
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3523,9 +3523,9 @@ class ComposerStaticInit459af300f88369828b2c5381ea17dddb
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit459af300f88369828b2c5381ea17dddb::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit459af300f88369828b2c5381ea17dddb::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit459af300f88369828b2c5381ea17dddb::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit7ade9639c4b2634a59b028a99a4c8a81::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7ade9639c4b2634a59b028a99a4c8a81::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7ade9639c4b2634a59b028a99a4c8a81::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1462,17 +1462,17 @@
},
{
"name": "rector\/rector-nette",
"version": "0.11.46",
"version_normalized": "0.11.46.0",
"version": "0.11.47",
"version_normalized": "0.11.47.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-nette.git",
"reference": "e6406acab409e80b1258b0c292cdbf2a3a79365f"
"reference": "eddbf4ee25207951034e1b9b05378677afae22df"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/e6406acab409e80b1258b0c292cdbf2a3a79365f",
"reference": "e6406acab409e80b1258b0c292cdbf2a3a79365f",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/eddbf4ee25207951034e1b9b05378677afae22df",
"reference": "eddbf4ee25207951034e1b9b05378677afae22df",
"shasum": ""
},
"require": {
@ -1500,7 +1500,7 @@
"symplify\/phpstan-rules": "^10.0",
"symplify\/rule-doc-generator": "^10.0"
},
"time": "2021-11-06T01:21:50+00:00",
"time": "2021-11-06T12:07:17+00:00",
"type": "rector-extension",
"extra": {
"branch-alias": {
@ -1528,7 +1528,7 @@
"description": "Rector upgrades rules for Nette Framework",
"support": {
"issues": "https:\/\/github.com\/rectorphp\/rector-nette\/issues",
"source": "https:\/\/github.com\/rectorphp\/rector-nette\/tree\/0.11.46"
"source": "https:\/\/github.com\/rectorphp\/rector-nette\/tree\/0.11.47"
},
"install-path": "..\/rector\/rector-nette"
},
@ -1657,17 +1657,17 @@
},
{
"name": "rector\/rector-symfony",
"version": "0.11.37",
"version_normalized": "0.11.37.0",
"version": "0.11.38",
"version_normalized": "0.11.38.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "acfb0e9ac4752910dd50a2806be2253c4dd87925"
"reference": "46437972a8bd80834e263b6b325defffd5c5ebf3"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/acfb0e9ac4752910dd50a2806be2253c4dd87925",
"reference": "acfb0e9ac4752910dd50a2806be2253c4dd87925",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/46437972a8bd80834e263b6b325defffd5c5ebf3",
"reference": "46437972a8bd80834e263b6b325defffd5c5ebf3",
"shasum": ""
},
"require": {
@ -1692,7 +1692,7 @@
"symplify\/phpstan-rules": "^10.0",
"symplify\/rule-doc-generator": "^10.0"
},
"time": "2021-11-06T01:15:43+00:00",
"time": "2021-11-06T11:56:49+00:00",
"type": "rector-extension",
"extra": {
"branch-alias": {
@ -1717,7 +1717,7 @@
"description": "Rector upgrades rules for Symfony Framework",
"support": {
"issues": "https:\/\/github.com\/rectorphp\/rector-symfony\/issues",
"source": "https:\/\/github.com\/rectorphp\/rector-symfony\/tree\/0.11.37"
"source": "https:\/\/github.com\/rectorphp\/rector-symfony\/tree\/0.11.38"
},
"install-path": "..\/rector\/rector-symfony"
},

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.31'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.11'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.46'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.21'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.37'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.30'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.31'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.11'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.47'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.7'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.21'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => '0.11.38'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'v0.11.30'));
private function __construct()
{
}

View File

@ -12,7 +12,6 @@ use Rector\Core\ValueObject\MethodName;
use Rector\Nette\Contract\FormControlTypeResolverInterface;
use Rector\Nette\NodeResolver\MethodNamesByInputNamesResolver;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use RectorPrefix20211106\Symfony\Contracts\Service\Attribute\Required;
final class ThisVariableInAnotherMethodFormControlTypeResolver implements \Rector\Nette\Contract\FormControlTypeResolverInterface
{
@ -49,7 +48,7 @@ final class ThisVariableInAnotherMethodFormControlTypeResolver implements \Recto
if (!$node instanceof \PhpParser\Node\Expr\Variable) {
return [];
}
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return [];
}

View File

@ -10,6 +10,7 @@ use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
use PHPStan\Type\ObjectType;
use Rector\BetterPhpDocParser\PhpDocManipulator\VarAnnotationManipulator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Nette\NodeAdding\FunctionLikeFirstLevelStatementResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
@ -31,11 +32,16 @@ final class AssignAnalyzer
* @var \Rector\BetterPhpDocParser\PhpDocManipulator\VarAnnotationManipulator
*/
private $varAnnotationManipulator;
public function __construct(\Rector\Nette\NodeAdding\FunctionLikeFirstLevelStatementResolver $functionLikeFirstLevelStatementResolver, \Rector\PostRector\Collector\NodesToAddCollector $nodesToAddCollector, \Rector\BetterPhpDocParser\PhpDocManipulator\VarAnnotationManipulator $varAnnotationManipulator)
/**
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
public function __construct(\Rector\Nette\NodeAdding\FunctionLikeFirstLevelStatementResolver $functionLikeFirstLevelStatementResolver, \Rector\PostRector\Collector\NodesToAddCollector $nodesToAddCollector, \Rector\BetterPhpDocParser\PhpDocManipulator\VarAnnotationManipulator $varAnnotationManipulator, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder)
{
$this->functionLikeFirstLevelStatementResolver = $functionLikeFirstLevelStatementResolver;
$this->nodesToAddCollector = $nodesToAddCollector;
$this->varAnnotationManipulator = $varAnnotationManipulator;
$this->betterNodeFinder = $betterNodeFinder;
}
public function addAssignExpressionForFirstCase(string $variableName, \PhpParser\Node\Expr\ArrayDimFetch $arrayDimFetch, \PHPStan\Type\ObjectType $controlObjectType) : void
{
@ -48,7 +54,7 @@ final class AssignAnalyzer
}
private function shouldSkipForAlreadyAddedInCurrentClassMethod(\PhpParser\Node\Expr\ArrayDimFetch $arrayDimFetch, string $variableName) : bool
{
$classMethod = $arrayDimFetch->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($arrayDimFetch, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}

View File

@ -95,7 +95,7 @@ final class MethodCallManipulator
public function findMethodCallsOnVariable(\PhpParser\Node\Expr\Variable $variable) : array
{
// get scope node, e.g. parent function call, method call or anonymous function
$classMethod = $variable->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($variable, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return [];
}

View File

@ -129,7 +129,7 @@ CODE_SAMPLE
return null;
}
$this->assignAnalyzer->addAssignExpressionForFirstCase($variableName, $node, $controlObjectType);
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if ($classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
$this->arrayDimFetchRenamer->renameToVariable($classMethod, $node, $variableName);
}

View File

@ -12,7 +12,6 @@ use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\ClassMethod;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Symfony\Bridge\NodeAnalyzer\ControllerMethodAnalyzer;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -143,7 +142,7 @@ CODE_SAMPLE
if (!$this->isName($node->name, 'getRequest') && !$this->isGetMethodCallWithRequestParameters($node)) {
return \false;
}
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return \false;
}

View File

@ -93,7 +93,7 @@ CODE_SAMPLE
if (!$classReflection->isSubclassOf('Twig_Extension')) {
return null;
}
$classMethod = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::METHOD_NODE);
$classMethod = $this->betterNodeFinder->findParentType($node, \PhpParser\Node\Stmt\ClassMethod::class);
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
return null;
}

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('RectorPrefix20211106\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit459af300f88369828b2c5381ea17dddb', false) && !interface_exists('ComposerAutoloaderInit459af300f88369828b2c5381ea17dddb', false) && !trait_exists('ComposerAutoloaderInit459af300f88369828b2c5381ea17dddb', false)) {
spl_autoload_call('RectorPrefix20211106\ComposerAutoloaderInit459af300f88369828b2c5381ea17dddb');
if (!class_exists('ComposerAutoloaderInit7ade9639c4b2634a59b028a99a4c8a81', false) && !interface_exists('ComposerAutoloaderInit7ade9639c4b2634a59b028a99a4c8a81', false) && !trait_exists('ComposerAutoloaderInit7ade9639c4b2634a59b028a99a4c8a81', false)) {
spl_autoload_call('RectorPrefix20211106\ComposerAutoloaderInit7ade9639c4b2634a59b028a99a4c8a81');
}
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('RectorPrefix20211106\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3306,9 +3306,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20211106\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire459af300f88369828b2c5381ea17dddb')) {
function composerRequire459af300f88369828b2c5381ea17dddb() {
return \RectorPrefix20211106\composerRequire459af300f88369828b2c5381ea17dddb(...func_get_args());
if (!function_exists('composerRequire7ade9639c4b2634a59b028a99a4c8a81')) {
function composerRequire7ade9639c4b2634a59b028a99a4c8a81() {
return \RectorPrefix20211106\composerRequire7ade9639c4b2634a59b028a99a4c8a81(...func_get_args());
}
}
if (!function_exists('parseArgs')) {