Updated Rector to commit f0425bc3cb3d5855da1bff9c38b872a9003e357b

f0425bc3cb Improve scope, PHPStan extension types (#2747)
This commit is contained in:
Tomas Votruba 2022-08-09 13:39:17 +00:00
parent 83bdde50fe
commit f7bb838601
120 changed files with 958 additions and 907 deletions

View File

@ -20,7 +20,7 @@
}
},
"conflict": {
"phpstan/phpdoc-parser": "<1.6.4",
"phpstan/phpdoc-parser": "<1.7",
"rector/rector-phpunit": "*",
"rector/rector-symfony": "*",
"rector/rector-doctrine": "*",

View File

@ -39,12 +39,12 @@ final class CommentsMerger
*/
public function keepParent(Node $newNode, Node $oldNode) : void
{
$parent = $oldNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $oldNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return;
}
$phpDocInfo = $parent->getAttribute(AttributeKey::PHP_DOC_INFO);
$comments = $parent->getComments();
$phpDocInfo = $parentNode->getAttribute(AttributeKey::PHP_DOC_INFO);
$comments = $parentNode->getComments();
if ($phpDocInfo === null && $comments === []) {
return;
}

View File

@ -226,24 +226,18 @@ final class PhpDocInfo
return $this->getTagsByName($name)[0] ?? null;
}
/**
* @param class-string[] $classes
* @param string[] $classes
*/
public function getByAnnotationClasses(array $classes) : ?DoctrineAnnotationTagValueNode
{
$doctrineAnnotationTagValueNodes = $this->phpDocNodeByTypeFinder->findDoctrineAnnotationsByClasses($this->phpDocNode, $classes);
return $doctrineAnnotationTagValueNodes[0] ?? null;
}
/**
* @param class-string $class
*/
public function getByAnnotationClass(string $class) : ?DoctrineAnnotationTagValueNode
{
$doctrineAnnotationTagValueNodes = $this->phpDocNodeByTypeFinder->findDoctrineAnnotationsByClass($this->phpDocNode, $class);
return $doctrineAnnotationTagValueNodes[0] ?? null;
}
/**
* @param class-string $class
*/
public function hasByAnnotationClass(string $class) : bool
{
return $this->findByAnnotationClass($class) !== [];
@ -269,9 +263,6 @@ final class PhpDocInfo
}
return null;
}
/**
* @param class-string $desiredClass
*/
public function findOneByAnnotationClass(string $desiredClass) : ?DoctrineAnnotationTagValueNode
{
$foundTagValueNodes = $this->findByAnnotationClass($desiredClass);

View File

@ -31,7 +31,7 @@ final class PhpDocNodeByTypeFinder
return $foundNodes;
}
/**
* @param class-string[] $classes
* @param string[] $classes
* @return DoctrineAnnotationTagValueNode[]
*/
public function findDoctrineAnnotationsByClasses(PhpDocNode $phpDocNode, array $classes) : array

View File

@ -65,10 +65,10 @@ final class UnionTypeNodePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor imp
return $starAndEnd;
}
// unwrap with parent array type...
$parent = $unionTypeNode->getAttribute(PhpDocAttributeKey::PARENT);
if (!$parent instanceof Node) {
$parentNode = $unionTypeNode->getAttribute(PhpDocAttributeKey::PARENT);
if (!$parentNode instanceof Node) {
return null;
}
return $parent->getAttribute(PhpDocAttributeKey::START_AND_END);
return $parentNode->getAttribute(PhpDocAttributeKey::START_AND_END);
}
}

View File

@ -33,9 +33,9 @@ final class NameNameResolver implements NodeNameResolverInterface
public function resolve(Node $node) : ?string
{
// possible function parent
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof FuncCall) {
return $this->funcCallNameResolver->resolve($parent);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof FuncCall) {
return $this->funcCallNameResolver->resolve($parentNode);
}
$resolvedName = $node->getAttribute(AttributeKey::RESOLVED_NAME);
if ($resolvedName instanceof FullyQualified) {

View File

@ -79,9 +79,9 @@ final class ContextAnalyzer
if (!$superType->yes()) {
continue;
}
$next = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($next instanceof Node) {
if ($next instanceof Return_ && $next->expr === null) {
$nextNode = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($nextNode instanceof Node) {
if ($nextNode instanceof Return_ && $nextNode->expr === null) {
continue;
}
$hasAssign = (bool) $this->betterNodeFinder->findInstanceOf($if->stmts, Assign::class);

View File

@ -29,14 +29,14 @@ final class BreakingRemovalGuard
*/
public function isLegalNodeRemoval(Node $node) : bool
{
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof If_ && $parent->cond === $node) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof If_ && $parentNode->cond === $node) {
return \false;
}
if ($parent instanceof BooleanNot) {
$parent = $parent->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof BooleanNot) {
$parentNode = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
}
if ($parent instanceof Assign) {
if ($parentNode instanceof Assign) {
return \false;
}
if ($this->isIfCondition($node)) {

View File

@ -81,10 +81,10 @@ final class VariableTypeResolver implements NodeTypeResolverInterface
}
private function resolveFromParentNodes(Variable $variable) : ?Scope
{
$parent = $variable->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $variable->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return null;
}
return $parent->getAttribute(AttributeKey::SCOPE);
return $parentNode->getAttribute(AttributeKey::SCOPE);
}
}

View File

@ -256,11 +256,11 @@ final class PHPStanNodeScopeResolver
$originalStmt->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
$originalStmt->setAttribute(AttributeKey::SCOPE, $mutatingScope);
$this->processNodes([$originalStmt], $smartFileInfo, $mutatingScope);
$next = $originalStmt->getAttribute(AttributeKey::NEXT_NODE);
while ($next instanceof Stmt) {
$next->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
$this->processNodes([$next], $smartFileInfo, $mutatingScope);
$next = $next->getAttribute(AttributeKey::NEXT_NODE);
$nextNode = $originalStmt->getAttribute(AttributeKey::NEXT_NODE);
while ($nextNode instanceof Stmt) {
$nextNode->setAttribute(AttributeKey::IS_UNREACHABLE, \true);
$this->processNodes([$nextNode], $smartFileInfo, $mutatingScope);
$nextNode = $nextNode->getAttribute(AttributeKey::NEXT_NODE);
}
}
private function processProperty(Property $property, MutatingScope $mutatingScope) : void

View File

@ -115,8 +115,8 @@ final class NameImportingPhpDocNodeVisitor extends AbstractPhpDocNodeVisitor
if ($this->classNameImportSkipper->shouldSkipNameForFullyQualifiedObjectType($file, $phpParserNode, $fullyQualifiedObjectType)) {
return null;
}
$parent = $identifierTypeNode->getAttribute(PhpDocAttributeKey::PARENT);
if ($parent instanceof TemplateTagValueNode) {
$parentNode = $identifierTypeNode->getAttribute(PhpDocAttributeKey::PARENT);
if ($parentNode instanceof TemplateTagValueNode) {
// might break
return null;
}

View File

@ -8,6 +8,7 @@ use PhpParser\Node\Expr;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Return_;
use PHPStan\Analyser\MutatingScope;
use Rector\ChangesReporting\Collector\RectorChangeCollector;
use Rector\Core\Application\ChangedNodeScopeRefresher;
use Rector\Core\Contract\PhpParser\NodePrinterInterface;
@ -65,7 +66,9 @@ final class NodesToAddCollector implements NodeCollectorInterface
$message = \sprintf('Switch arguments in "%s()" method', __METHOD__);
throw new ShouldNotHappenException($message);
}
$this->changedNodeScopeRefresher->refresh($addedNode, $positionNode->getAttribute(AttributeKey::SCOPE));
/** @var MutatingScope|null $currentScope */
$currentScope = $positionNode->getAttribute(AttributeKey::SCOPE);
$this->changedNodeScopeRefresher->refresh($addedNode, $currentScope);
$position = $this->resolveNearestStmtPosition($positionNode);
$this->nodesToAddBefore[$position][] = $this->wrapToExpression($addedNode);
$this->rectorChangeCollector->notifyNodeFileInfo($positionNode);
@ -94,7 +97,9 @@ final class NodesToAddCollector implements NodeCollectorInterface
$message = \sprintf('Switch arguments in "%s()" method', __METHOD__);
throw new ShouldNotHappenException($message);
}
$this->changedNodeScopeRefresher->refresh($addedNode, $positionNode->getAttribute(AttributeKey::SCOPE));
/** @var MutatingScope|null $currentScope */
$currentScope = $positionNode->getAttribute(AttributeKey::SCOPE);
$this->changedNodeScopeRefresher->refresh($addedNode, $currentScope);
$position = $this->resolveNearestStmtPosition($positionNode);
$this->nodesToAddAfter[$position][] = $this->wrapToExpression($addedNode);
$this->rectorChangeCollector->notifyNodeFileInfo($positionNode);
@ -145,9 +150,9 @@ final class NodesToAddCollector implements NodeCollectorInterface
if ($currentStmt instanceof Stmt) {
return \spl_object_hash($currentStmt);
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Return_) {
return \spl_object_hash($parent);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Return_) {
return \spl_object_hash($parentNode);
}
$foundStmt = $this->betterNodeFinder->findParentType($node, Stmt::class);
if (!$foundStmt instanceof Stmt) {

View File

@ -65,28 +65,28 @@ final class ReadWritePropertyAnalyzer
*/
public function isRead($node) : bool
{
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
throw new ShouldNotHappenException();
}
foreach ($this->parentNodeReadAnalyzers as $parentNodeReadAnalyzer) {
if ($parentNodeReadAnalyzer->isRead($node, $parent)) {
if ($parentNodeReadAnalyzer->isRead($node, $parentNode)) {
return \true;
}
}
if ($parent instanceof AssignOp) {
if ($parentNode instanceof AssignOp) {
return \true;
}
if (!$parent instanceof ArrayDimFetch) {
if (!$parentNode instanceof ArrayDimFetch) {
return !$this->assignManipulator->isLeftPartOfAssign($node);
}
if ($parent->dim === $node && $this->isNotInsideIssetUnset($parent)) {
return $this->isArrayDimFetchRead($parent);
if ($parentNode->dim === $node && $this->isNotInsideIssetUnset($parentNode)) {
return $this->isArrayDimFetchRead($parentNode);
}
if ($this->assignManipulator->isLeftPartOfAssign($parent)) {
if ($this->assignManipulator->isLeftPartOfAssign($parentNode)) {
return \false;
}
return !$this->isArrayDimFetchInImpureFunction($parent, $node);
return !$this->isArrayDimFetchInImpureFunction($parentNode, $node);
}
private function isArrayDimFetchInImpureFunction(ArrayDimFetch $arrayDimFetch, Node $node) : bool
{
@ -108,8 +108,8 @@ final class ReadWritePropertyAnalyzer
}
private function isArrayDimFetchRead(ArrayDimFetch $arrayDimFetch) : bool
{
$parentParent = $arrayDimFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentParent instanceof Node) {
$parentParentNode = $arrayDimFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentParentNode instanceof Node) {
throw new ShouldNotHappenException();
}
if (!$this->assignManipulator->isLeftPartOfAssign($arrayDimFetch)) {

View File

@ -14,21 +14,21 @@ final class JustReadExprAnalyzer
{
public function isReadContext(Expr $expr) : bool
{
$parent = $expr->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Return_) {
$parentNode = $expr->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Return_) {
return \true;
}
if ($parent instanceof Arg) {
if ($parentNode instanceof Arg) {
return \true;
}
if ($parent instanceof ArrayDimFetch) {
$parentParent = $parent->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof ArrayDimFetch) {
$parentParent = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentParent instanceof Assign) {
return \true;
}
return $parentParent->var !== $parent;
return $parentParent->var !== $parentNode;
}
// assume it's used by default
return !$parent instanceof Expression;
return !$parentNode instanceof Expression;
}
}

View File

@ -44,8 +44,8 @@ final class FullyQualifiedNodeMapper implements PhpParserNodeMapperInterface
*/
public function mapToPHPStan(Node $node) : Type
{
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($this->isParamTyped($node, $parent)) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($this->isParamTyped($node, $parentNode)) {
$possibleAliasedObjectType = $this->resolvePossibleAliasedObjectType($node);
if ($possibleAliasedObjectType instanceof AliasedObjectType) {
return $possibleAliasedObjectType;

View File

@ -102,9 +102,9 @@ final class ForAnalyzer
public function isArrayWithKeyValueNameUnsetted(For_ $for) : bool
{
return (bool) $this->betterNodeFinder->findFirst($for->stmts, static function (Node $node) : bool {
/** @var Node $parent */
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Unset_) {
/** @var Node $parentNode */
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Unset_) {
return \false;
}
return $node instanceof ArrayDimFetch;
@ -164,10 +164,10 @@ final class ForAnalyzer
if (!$node instanceof Arg) {
return \false;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof FuncCall) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof FuncCall) {
return \false;
}
return $this->nodeNameResolver->isName($parent, self::COUNT);
return $this->nodeNameResolver->isName($parentNode, self::COUNT);
}
}

View File

@ -73,8 +73,8 @@ CODE_SAMPLE
}
private function isTopMostConcatNode(Concat $concat) : bool
{
$parent = $concat->getAttribute(AttributeKey::PARENT_NODE);
return !$parent instanceof Concat;
$parentNode = $concat->getAttribute(AttributeKey::PARENT_NODE);
return !$parentNode instanceof Concat;
}
/**
* @return \PhpParser\Node\Expr\BinaryOp\Concat|\PhpParser\Node\Scalar\String_

View File

@ -89,10 +89,10 @@ CODE_SAMPLE
private function getUppermostConcat(FuncCall $funcCall) : ?Concat
{
$upperMostConcat = null;
$parent = $funcCall->getAttribute(AttributeKey::PARENT_NODE);
while ($parent instanceof Concat) {
$upperMostConcat = $parent;
$parent = $parent->getAttribute(AttributeKey::PARENT_NODE);
$parentNode = $funcCall->getAttribute(AttributeKey::PARENT_NODE);
while ($parentNode instanceof Concat) {
$upperMostConcat = $parentNode;
$parentNode = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
}
return $upperMostConcat;
}

View File

@ -118,9 +118,9 @@ CODE_SAMPLE
if (!$this->nodeComparator->areNodesEqual($previousAssign->var, $variable)) {
return null;
}
/** @var Return_ $next */
$next = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($this->isNextReturnIncorrect($cond, $variable, $next)) {
/** @var Return_ $nextNode */
$nextNode = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($this->isNextReturnIncorrect($cond, $variable, $nextNode)) {
return null;
}
$variableType = $this->assignVariableTypeResolver->resolve($previousAssign);
@ -129,7 +129,7 @@ CODE_SAMPLE
}
$className = $class->toString();
$types = $variableType->getTypes();
return $this->processSimplifyNullableReturn($variableType, $types, $className, $next, $previous, $previousAssign->expr);
return $this->processSimplifyNullableReturn($variableType, $types, $className, $nextNode, $previous, $previousAssign->expr);
}
/**
* @param \PhpParser\Node\Expr\BooleanNot|\PhpParser\Node\Expr\Instanceof_ $expr
@ -203,8 +203,8 @@ CODE_SAMPLE
if (!$this->ifManipulator->isIfWithOnly($if, Return_::class)) {
return \true;
}
$next = $if->getAttribute(AttributeKey::NEXT_NODE);
if (!$next instanceof Return_) {
$nextNode = $if->getAttribute(AttributeKey::NEXT_NODE);
if (!$nextNode instanceof Return_) {
return \true;
}
$cond = $if->cond;

View File

@ -107,11 +107,11 @@ CODE_SAMPLE
}
private function shouldSkipPropertyFetch(PropertyFetch $propertyFetch) : bool
{
$parent = $propertyFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Assign) {
$parentNode = $propertyFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Assign) {
return \false;
}
return $parent->var === $propertyFetch;
return $parentNode->var === $propertyFetch;
}
/**
* @return \PhpParser\Node\Expr\MethodCall|null

View File

@ -136,21 +136,21 @@ CODE_SAMPLE
});
/** @var TryCatch $tryCatch */
$tryCatch = $catch->getAttribute(AttributeKey::PARENT_NODE);
$next = $tryCatch->getAttribute(AttributeKey::NEXT_NODE);
$this->replaceNextUsageVariable($tryCatch, $next, $oldVariableName, $newVariableName);
$nextNode = $tryCatch->getAttribute(AttributeKey::NEXT_NODE);
$this->replaceNextUsageVariable($tryCatch, $nextNode, $oldVariableName, $newVariableName);
}
private function replaceNextUsageVariable(Node $currentNode, ?Node $nextNode, string $oldVariableName, string $newVariableName) : void
{
if (!$nextNode instanceof Node) {
$parent = $currentNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $currentNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return;
}
if ($parent instanceof FunctionLike) {
if ($parentNode instanceof FunctionLike) {
return;
}
$nextNode = $parent->getAttribute(AttributeKey::NEXT_NODE);
$this->replaceNextUsageVariable($parent, $nextNode, $oldVariableName, $newVariableName);
$nextNode = $parentNode->getAttribute(AttributeKey::NEXT_NODE);
$this->replaceNextUsageVariable($parentNode, $nextNode, $oldVariableName, $newVariableName);
return;
}
/** @var Variable[] $variables */
@ -174,8 +174,8 @@ CODE_SAMPLE
private function processRenameVariable(array $variables, string $oldVariableName, string $newVariableName) : bool
{
foreach ($variables as $variable) {
$parent = $variable->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Assign && $this->nodeComparator->areNodesEqual($parent->var, $variable) && $this->nodeNameResolver->isName($parent->var, $oldVariableName) && !$this->nodeComparator->areNodesEqual($parent->expr, $variable)) {
$parentNode = $variable->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Assign && $this->nodeComparator->areNodesEqual($parentNode->var, $variable) && $this->nodeNameResolver->isName($parentNode->var, $oldVariableName) && !$this->nodeComparator->areNodesEqual($parentNode->expr, $variable)) {
return \false;
}
$variable->name = $newVariableName;

View File

@ -98,14 +98,14 @@ CODE_SAMPLE
*/
private function removeOrChangeAssignToVariable($node, Assign $assign, string $variableName)
{
$parent = $assign->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Expression) {
$parentNode = $assign->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Expression) {
$this->removeNode($assign);
return $this->applyVariadicParams($node, $variableName);
}
$variable = $assign->var;
/** @var ClassMethod|Function_|Closure $functionLike */
$functionLike = $this->betterNodeFinder->findParentType($parent, FunctionLike::class);
$functionLike = $this->betterNodeFinder->findParentType($parentNode, FunctionLike::class);
/** @var Stmt[] $stmts */
$stmts = $functionLike->getStmts();
$this->traverseNodesWithCallable($stmts, function (Node $node) use($assign, $variable) : ?Expr {

View File

@ -214,9 +214,9 @@ CODE_SAMPLE
}
private function resolveVarType(PropertyProperty $propertyProperty) : Type
{
/** @var Property $property */
$property = $propertyProperty->getAttribute(AttributeKey::PARENT_NODE);
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
/** @var Property $propertyNode */
$propertyNode = $propertyProperty->getAttribute(AttributeKey::PARENT_NODE);
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($propertyNode);
return $phpDocInfo->getVarType();
}
/**

View File

@ -70,19 +70,19 @@ CODE_SAMPLE
if (!$this->isArray($expr)) {
return null;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return null;
}
$processIdentical = $this->processIdenticalOrNotIdentical($parent, $node, $expr);
$processIdentical = $this->processIdenticalOrNotIdentical($parentNode, $node, $expr);
if ($processIdentical !== null) {
return $processIdentical;
}
$processGreaterOrSmaller = $this->processGreaterOrSmaller($parent, $node, $expr);
$processGreaterOrSmaller = $this->processGreaterOrSmaller($parentNode, $node, $expr);
if ($processGreaterOrSmaller !== null) {
return $processGreaterOrSmaller;
}
return $this->processMarkTruthy($parent, $node, $expr);
return $this->processMarkTruthy($parentNode, $node, $expr);
}
private function processMarkTruthyNegation(BooleanNot $booleanNot) : ?Identical
{

View File

@ -84,15 +84,15 @@ final class DeadParamTagValueNodeAnalyzer
if ($paramTagValueNode->description !== '') {
return \false;
}
$parent = $paramTagValueNode->getAttribute(PhpDocAttributeKey::PARENT);
if (!$parent instanceof PhpDocTagNode) {
$parentNode = $paramTagValueNode->getAttribute(PhpDocAttributeKey::PARENT);
if (!$parentNode instanceof PhpDocTagNode) {
return \true;
}
$parent = $parent->getAttribute(PhpDocAttributeKey::PARENT);
if (!$parent instanceof PhpDocNode) {
$parentNode = $parentNode->getAttribute(PhpDocAttributeKey::PARENT);
if (!$parentNode instanceof PhpDocNode) {
return \true;
}
$children = $parent->children;
$children = $parentNode->children;
foreach ($children as $key => $child) {
if ($child instanceof PhpDocTagNode && $node instanceof FullyQualified) {
return $this->isUnionIdentifier($child);

View File

@ -138,11 +138,11 @@ CODE_SAMPLE
if (!$type instanceof BooleanType) {
return \false;
}
$next = $ifWithOnlyReturns[0]->getAttribute(AttributeKey::NEXT_NODE);
if (!$next instanceof Return_) {
$nextNode = $ifWithOnlyReturns[0]->getAttribute(AttributeKey::NEXT_NODE);
if (!$nextNode instanceof Return_) {
return \false;
}
$expr = $next->expr;
$expr = $nextNode->expr;
if (!$expr instanceof Expr) {
return \false;
}

View File

@ -99,17 +99,17 @@ CODE_SAMPLE
return null;
}
// if->cond cannot removed, it has to be replaced with false, see https://3v4l.org/U9S9i
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof If_ && $parent->cond === $node) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof If_ && $parentNode->cond === $node) {
return $this->nodeFactory->createFalse();
}
if ($parent instanceof Assign) {
if ($parentNode instanceof Assign) {
return $this->nodeFactory->createFalse();
}
if ($parent instanceof ArrowFunction && $this->nodeComparator->areNodesEqual($parent->expr, $node)) {
return $this->processArrowFunction($parent, $node);
if ($parentNode instanceof ArrowFunction && $this->nodeComparator->areNodesEqual($parentNode->expr, $node)) {
return $this->processArrowFunction($parentNode, $node);
}
if (!$parent instanceof Expression) {
if (!$parentNode instanceof Expression) {
return null;
}
$this->removeNode($node);
@ -124,11 +124,7 @@ CODE_SAMPLE
if ($parentArg instanceof Arg) {
return null;
}
$scope = $methodCall->var->getAttribute(AttributeKey::SCOPE);
if (!$scope instanceof Scope) {
return null;
}
return $scope;
return $methodCall->var->getAttribute(AttributeKey::SCOPE);
}
/**
* @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Trait_|\PhpParser\Node\Stmt\Interface_|\PhpParser\Node\Stmt\Enum_ $classLike
@ -169,8 +165,8 @@ CODE_SAMPLE
*/
private function processArrowFunction(ArrowFunction $arrowFunction, MethodCall $methodCall)
{
$parentOfParent = $arrowFunction->getAttribute(AttributeKey::PARENT_NODE);
if ($parentOfParent instanceof Expression) {
$parentParentNode = $arrowFunction->getAttribute(AttributeKey::PARENT_NODE);
if ($parentParentNode instanceof Expression) {
$this->removeNode($arrowFunction);
return $methodCall;
}

View File

@ -47,9 +47,9 @@ CODE_SAMPLE
*/
public function refactor(Node $node) : ?Node
{
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
// skip typed properties
if ($parent instanceof Property && $parent->type !== null) {
if ($parentNode instanceof Property && $parentNode->type !== null) {
return null;
}
$defaultValueNode = $node->default;

View File

@ -110,8 +110,8 @@ CODE_SAMPLE
if ($this->classMethodManipulator->hasParentMethodOrInterfaceMethod($classMethod, $calledMethodName)) {
return null;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Expression) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Expression) {
return null;
}
$this->removeNode($node);
@ -129,8 +129,8 @@ CODE_SAMPLE
}
private function processNoParentReflection(StaticCall $staticCall) : ?ConstFetch
{
$parent = $staticCall->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Expression) {
$parentNode = $staticCall->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Expression) {
return $this->nodeFactory->createNull();
}
$this->removeNode($staticCall);

View File

@ -232,13 +232,13 @@ CODE_SAMPLE
if ($nextStmt instanceof Node) {
return $nextStmt instanceof Return_;
}
$parent = $if->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $if->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return \false;
}
if ($parent instanceof If_) {
return $this->isLastIfOrBeforeLastReturn($parent, $nextStmt);
if ($parentNode instanceof If_) {
return $this->isLastIfOrBeforeLastReturn($parentNode, $nextStmt);
}
return !$this->contextAnalyzer->hasAssignWithIndirectReturn($parent, $if);
return !$this->contextAnalyzer->hasAssignWithIndirectReturn($parentNode, $if);
}
}

View File

@ -87,8 +87,8 @@ CODE_SAMPLE
/** @var Return_ $return */
$return = $node->stmts[0];
// same return? skip
$next = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($next instanceof Return_ && $this->nodeComparator->areNodesEqual($return, $next)) {
$nextNode = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($nextNode instanceof Return_ && $this->nodeComparator->areNodesEqual($return, $nextNode)) {
return null;
}
$ifs = $this->createMultipleIfs($node->cond, $return, []);

View File

@ -179,19 +179,19 @@ CODE_SAMPLE
*/
private function getIfsBefore(Return_ $return) : array
{
$parent = $return->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof FunctionLike && !$parent instanceof If_) {
$parentNode = $return->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof FunctionLike && !$parentNode instanceof If_) {
return [];
}
if ($parent->stmts === []) {
if ($parentNode->stmts === []) {
return [];
}
\end($parent->stmts);
$firstItemPosition = \key($parent->stmts);
if ($parent->stmts[$firstItemPosition] !== $return) {
\end($parentNode->stmts);
$firstItemPosition = \key($parentNode->stmts);
if ($parentNode->stmts[$firstItemPosition] !== $return) {
return [];
}
return $this->collectIfs($parent->stmts, $return);
return $this->collectIfs($parentNode->stmts, $return);
}
/**
* @param If_[] $stmts

View File

@ -70,8 +70,8 @@ final class VariableRenamer
return null;
}
// skip param names
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Param) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Param) {
return null;
}
// TODO: Remove in next PR (with above param check?),

View File

@ -68,12 +68,12 @@ final class FullyQualifyStmtsAnalyzer
if ($this->isNativeConstant($node)) {
return null;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof GroupUse) {
$parent->setAttribute(AttributeKey::ORIGINAL_NODE, null);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof GroupUse) {
$parentNode->setAttribute(AttributeKey::ORIGINAL_NODE, null);
return null;
}
if ($parent instanceof UseUse) {
if ($parentNode instanceof UseUse) {
return null;
}
return new FullyQualified($name);
@ -81,8 +81,8 @@ final class FullyQualifyStmtsAnalyzer
}
private function isNativeConstant(Name $name) : bool
{
$parent = $name->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof ConstFetch) {
$parentNode = $name->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof ConstFetch) {
return \false;
}
$scope = $name->getAttribute(AttributeKey::SCOPE);

View File

@ -111,11 +111,11 @@ CODE_SAMPLE
}
private function isPartOfIsAFuncCall(String_ $string) : bool
{
$parent = $string->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Arg) {
$parentNode = $string->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Arg) {
return \false;
}
$parentParent = $parent->getAttribute(AttributeKey::PARENT_NODE);
$parentParent = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentParent instanceof FuncCall) {
return \false;
}

View File

@ -68,16 +68,16 @@ CODE_SAMPLE
$exprUsages = $this->betterNodeFinder->findSameNamedExprs($assignedVar);
// detect if is part of variable assign?
foreach ($exprUsages as $exprUsage) {
$parent = $exprUsage->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof ArrayDimFetch) {
$parentNode = $exprUsage->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof ArrayDimFetch) {
continue;
}
$firstAssign = $this->betterNodeFinder->findParentType($parent, Assign::class);
$firstAssign = $this->betterNodeFinder->findParentType($parentNode, Assign::class);
if (!$firstAssign instanceof Assign) {
continue;
}
// skip explicit assigns
if ($parent->dim !== null) {
if ($parentNode->dim !== null) {
continue;
}
$shouldRetype = \true;

View File

@ -34,25 +34,25 @@ final class ClosureNestedUsesDecorator
}
public function applyNestedUses(Closure $anonymousFunctionNode, Variable $useVariable) : Closure
{
$parent = $this->betterNodeFinder->findParentType($useVariable, Closure::class);
if (!$parent instanceof Closure) {
$parentNode = $this->betterNodeFinder->findParentType($useVariable, Closure::class);
if (!$parentNode instanceof Closure) {
return $anonymousFunctionNode;
}
$paramNames = $this->nodeNameResolver->getNames($parent->params);
$paramNames = $this->nodeNameResolver->getNames($parentNode->params);
if ($this->nodeNameResolver->isNames($useVariable, $paramNames)) {
return $anonymousFunctionNode;
}
$anonymousFunctionNode = clone $anonymousFunctionNode;
while ($parent instanceof Closure) {
$parentOfParent = $this->betterNodeFinder->findParentType($parent, Closure::class);
while ($parentNode instanceof Closure) {
$parentOfParent = $this->betterNodeFinder->findParentType($parentNode, Closure::class);
$uses = [];
while ($parentOfParent instanceof Closure) {
$uses = $this->collectUsesEqual($parentOfParent, $uses, $useVariable);
$parentOfParent = $this->betterNodeFinder->findParentType($parentOfParent, Closure::class);
}
$uses = \array_merge($parent->uses, $uses);
$parent->uses = $this->cleanClosureUses($uses);
$parent = $this->betterNodeFinder->findParentType($parent, Closure::class);
$uses = \array_merge($parentNode->uses, $uses);
$parentNode->uses = $this->cleanClosureUses($uses);
$parentNode = $this->betterNodeFinder->findParentType($parentNode, Closure::class);
}
return $anonymousFunctionNode;
}

View File

@ -101,12 +101,12 @@ CODE_SAMPLE
if (!$classLike instanceof Class_) {
return \true;
}
$parent = $funcCall->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Ternary) {
if ($this->isIdenticalToNotNull($funcCall, $parent)) {
$parentNode = $funcCall->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Ternary) {
if ($this->isIdenticalToNotNull($funcCall, $parentNode)) {
return \true;
}
return $this->isNotIdenticalToNull($funcCall, $parent);
return $this->isNotIdenticalToNull($funcCall, $parentNode);
}
return \false;
}

View File

@ -120,11 +120,11 @@ final class MatchSwitchAnalyzer
}
private function isNextStmtReturnWithExpr(Switch_ $switch) : bool
{
$next = $switch->getAttribute(AttributeKey::NEXT_NODE);
if (!$next instanceof Return_) {
$nextNode = $switch->getAttribute(AttributeKey::NEXT_NODE);
if (!$nextNode instanceof Return_) {
return \false;
}
if (!$next->expr instanceof Expr) {
if (!$nextNode->expr instanceof Expr) {
return \false;
}
foreach ($switch->cases as $case) {
@ -136,7 +136,7 @@ final class MatchSwitchAnalyzer
if (!$expression->expr instanceof Assign) {
continue;
}
if (!$this->nodeComparator->areNodesEqual($expression->expr->var, $next->expr)) {
if (!$this->nodeComparator->areNodesEqual($expression->expr->var, $nextNode->expr)) {
return \false;
}
}

View File

@ -65,8 +65,8 @@ final class ResourceReturnToObject
*/
private function processFuncCall(FuncCall $funcCall, array $collectionFunctionToReturnObject) : ?Instanceof_
{
$parent = $funcCall->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof BinaryOp && !$parent instanceof BooleanOr) {
$parentNode = $funcCall->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof BinaryOp && !$parentNode instanceof BooleanOr) {
return null;
}
if ($this->shouldSkip($funcCall)) {

View File

@ -5,18 +5,18 @@ namespace Rector\Removing\Rector\Class_;
use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\NodeCollector\ScopeResolver\ParentClassScopeResolver;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
use RectorPrefix202208\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Removing\Rector\Class_\RemoveParentRector\RemoveParentRectorTest
*/
final class RemoveParentRector extends AbstractRector implements ConfigurableRectorInterface
final class RemoveParentRector extends AbstractScopeAwareRector implements ConfigurableRectorInterface
{
/**
* @var string[]
@ -55,9 +55,8 @@ CODE_SAMPLE
/**
* @param Class_ $node
*/
public function refactor(Node $node) : ?Node
public function refactorWithScope(Node $node, Scope $scope) : ?Node
{
$scope = $node->getAttribute(AttributeKey::SCOPE);
$parentClassReflection = $this->parentClassScopeResolver->resolveParentClassReflection($scope);
if (!$parentClassReflection instanceof ClassReflection) {
return null;

View File

@ -101,15 +101,15 @@ final class RenameNamespaceRector extends AbstractRector implements Configurable
$node->uses[0]->name = new Name($newName);
return $node;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
// already resolved above
if ($parent instanceof Namespace_) {
if ($parentNode instanceof Namespace_) {
return null;
}
if (!$parent instanceof UseUse) {
if (!$parentNode instanceof UseUse) {
return $this->processFullyQualified($node, $renamedNamespaceValueObject);
}
if ($parent->type !== Use_::TYPE_UNKNOWN) {
if ($parentNode->type !== Use_::TYPE_UNKNOWN) {
return $this->processFullyQualified($node, $renamedNamespaceValueObject);
}
return null;

View File

@ -98,7 +98,7 @@ final class ObjectTypeSpecifier
return null;
}
$className = $objectType->getClassName();
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
foreach ($uses as $use) {
$prefix = $this->useImportsResolver->resolvePrefix($use);
foreach ($use->uses as $useUse) {
@ -108,7 +108,7 @@ final class ObjectTypeSpecifier
$useName = $prefix . $useUse->name->toString();
$alias = $useUse->alias->toString();
$fullyQualifiedName = $prefix . $useUse->name->toString();
$processAliasedObject = $this->processAliasedObject($alias, $className, $useName, $parent, $fullyQualifiedName);
$processAliasedObject = $this->processAliasedObject($alias, $className, $useName, $parentNode, $fullyQualifiedName);
if ($processAliasedObject instanceof AliasedObjectType) {
return $processAliasedObject;
}

View File

@ -16,7 +16,7 @@ use PHPStan\Type\NeverType;
use PHPStan\Type\UnionType;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
use Rector\BetterPhpDocParser\ValueObject\Type\SpacingAwareArrayTypeNode;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\Core\Util\StringUtils;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
@ -26,7 +26,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector\ArrayShapeFromConstantArrayReturnRectorTest
*/
final class ArrayShapeFromConstantArrayReturnRector extends AbstractRector
final class ArrayShapeFromConstantArrayReturnRector extends AbstractScopeAwareRector
{
/**
* @see https://regex101.com/r/WvUD0m/2
@ -83,7 +83,7 @@ CODE_SAMPLE
/**
* @param ClassMethod $node
*/
public function refactor(Node $node) : ?Node
public function refactorWithScope(Node $node, Scope $scope) : ?Node
{
if ($this->isInTestCase($node)) {
return null;
@ -105,7 +105,7 @@ CODE_SAMPLE
if ($this->shouldSkip($returnExprType)) {
return null;
}
$returnType = $this->classMethodReturnTypeResolver->resolve($node, $node->getAttribute(AttributeKey::SCOPE));
$returnType = $this->classMethodReturnTypeResolver->resolve($node, $scope);
if ($returnType instanceof ConstantArrayType) {
return null;
}

View File

@ -83,11 +83,11 @@ CODE_SAMPLE
*/
public function refactor(Node $node) : ?Node
{
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof ClassMethod) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof ClassMethod) {
return null;
}
return $this->decorateParamWithType($parent, $node);
return $this->decorateParamWithType($parentNode, $node);
}
public function decorateParamWithType(ClassMethod $classMethod, Param $param) : ?Param
{

View File

@ -162,11 +162,11 @@ final class PHPUnitDataProviderParamTypeInferer implements ParamTypeInfererInter
}
private function getFunctionLikePhpDocInfo(Param $param) : PhpDocInfo
{
$parent = $param->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof FunctionLike) {
$parentNode = $param->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof FunctionLike) {
throw new ShouldNotHappenException();
}
return $this->phpDocInfoFactory->createFromNodeOrEmpty($parent);
return $this->phpDocInfoFactory->createFromNodeOrEmpty($parentNode);
}
/**
* @return Type[]

View File

@ -6,6 +6,7 @@ namespace Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\Property;
use PHPStan\Reflection\ClassMemberAccessAnswerer;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\Php\PhpPropertyReflection;
use PHPStan\Type\MixedType;
@ -76,6 +77,7 @@ final class SetterNodeReturnTypeInfererTypeInferer implements ReturnTypeInfererI
if (!$classReflection->hasProperty($returnedPropertyName)) {
continue;
}
/** @var ClassMemberAccessAnswerer $scope */
$propertyReflection = $classReflection->getProperty($returnedPropertyName, $scope);
if (!$propertyReflection instanceof PhpPropertyReflection) {
continue;

View File

@ -82,12 +82,12 @@ final class ChangedNodeScopeRefresher
if ($this->scopeAnalyzer->isScopeResolvableFromFile($node, $mutatingScope)) {
$mutatingScope = $this->scopeFactory->createFromFile($smartFileInfo);
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$mutatingScope instanceof MutatingScope && $node instanceof Expr && $parent instanceof Node) {
$mutatingScope = $parent->getAttribute(AttributeKey::SCOPE);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$mutatingScope instanceof MutatingScope && $node instanceof Expr && $parentNode instanceof Node) {
$mutatingScope = $parentNode->getAttribute(AttributeKey::SCOPE);
}
if (!$mutatingScope instanceof MutatingScope) {
$errorMessage = \sprintf('Node "%s" with parent of "%s" is missing scope required for scope refresh.', \get_class($node), \get_class($parent));
$errorMessage = \sprintf('Node "%s" with parent of "%s" is missing scope required for scope refresh.', \get_class($node), $parentNode instanceof \PhpParser\Node ? \get_class($parentNode) : 'unknown parent');
throw new ShouldNotHappenException($errorMessage);
}
// note from flight: when we traverse ClassMethod, the scope must be already in Class_, otherwise it crashes

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '07b54b48ec70f8349a36239316ecf5fb2b79798a';
public const PACKAGE_VERSION = 'f0425bc3cb3d5855da1bff9c38b872a9003e357b';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-08-09 12:02:23';
public const RELEASE_DATE = '2022-08-09 15:34:29';
/**
* @var int
*/

View File

@ -30,8 +30,8 @@ final class ClassAnalyzer
if (!$node instanceof Class_) {
return \false;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof New_) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof New_) {
return \false;
}
if ($node->isAnonymous()) {

View File

@ -30,7 +30,7 @@ final class ScopeAnalyzer
if ($mutatingScope instanceof MutatingScope) {
return \false;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
return !$parent instanceof Node;
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
return !$parentNode instanceof Node;
}
}

View File

@ -65,11 +65,11 @@ final class VariableAnalyzer
if (!$this->nodeComparator->areNodesEqual($subNode, $variable)) {
return \false;
}
$parent = $subNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof ClosureUse) {
$parentNode = $subNode->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof ClosureUse) {
return \false;
}
return $parent->byRef;
return $parentNode->byRef;
});
}
private function isParentStaticOrGlobal(Variable $variable) : bool

View File

@ -79,22 +79,22 @@ final class AssignManipulator
}
public function isLeftPartOfAssign(Node $node) : bool
{
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Assign && $this->nodeComparator->areNodesEqual($parent->var, $node)) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Assign && $this->nodeComparator->areNodesEqual($parentNode->var, $node)) {
return \true;
}
if ($parent !== null && $this->typeChecker->isInstanceOf($parent, self::MODIFYING_NODE_TYPES)) {
if ($parentNode !== null && $this->typeChecker->isInstanceOf($parentNode, self::MODIFYING_NODE_TYPES)) {
return \true;
}
// traverse up to array dim fetches
if ($parent instanceof ArrayDimFetch) {
$previousParent = $parent;
while ($parent instanceof ArrayDimFetch) {
$previousParent = $parent;
$parent = $parent->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof ArrayDimFetch) {
$previousParent = $parentNode;
while ($parentNode instanceof ArrayDimFetch) {
$previousParent = $parentNode;
$parentNode = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
}
if ($parent instanceof Assign) {
return $parent->var === $previousParent;
if ($parentNode instanceof Assign) {
return $parentNode->var === $previousParent;
}
}
return \false;

View File

@ -142,8 +142,8 @@ final class ClassMethodAssignManipulator
private function filterOutMultiAssigns(array $readOnlyVariableAssigns) : array
{
return \array_filter($readOnlyVariableAssigns, static function (Assign $assign) : bool {
$parent = $assign->getAttribute(AttributeKey::PARENT_NODE);
return !$parent instanceof Assign;
$parentNode = $assign->getAttribute(AttributeKey::PARENT_NODE);
return !$parentNode instanceof Assign;
});
}
/**
@ -192,8 +192,8 @@ final class ClassMethodAssignManipulator
if ($this->nodeNameResolver->isName($variable, 'this')) {
continue;
}
$parent = $variable->getAttribute(AttributeKey::PARENT_NODE);
if ($parent !== null && $this->isExplicitlyReferenced($parent)) {
$parentNode = $variable->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode !== null && $this->isExplicitlyReferenced($parentNode)) {
$variableName = $this->nodeNameResolver->getName($variable);
if ($variableName === null) {
continue;
@ -202,11 +202,11 @@ final class ClassMethodAssignManipulator
continue;
}
$argumentPosition = null;
if ($parent instanceof Arg) {
$argumentPosition = $parent->getAttribute(AttributeKey::ARGUMENT_POSITION);
$parent = $parent->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Arg) {
$argumentPosition = $parentNode->getAttribute(AttributeKey::ARGUMENT_POSITION);
$parentNode = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
}
if (!$parent instanceof Node) {
if (!$parentNode instanceof Node) {
continue;
}
if ($argumentPosition === null) {
@ -216,7 +216,7 @@ final class ClassMethodAssignManipulator
if ($variableName === null) {
continue;
}
if (!$this->isCallOrConstructorWithReference($parent, $variable, $argumentPosition)) {
if (!$this->isCallOrConstructorWithReference($parentNode, $variable, $argumentPosition)) {
continue;
}
$referencedVariables[] = $variableName;

View File

@ -292,27 +292,27 @@ final class PropertyManipulator
*/
private function isChangeableContext($propertyFetch) : bool
{
$parent = $propertyFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $propertyFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return \false;
}
if ($this->typeChecker->isInstanceOf($parent, [PreInc::class, PreDec::class, PostInc::class, PostDec::class])) {
$parent = $parent->getAttribute(AttributeKey::PARENT_NODE);
if ($this->typeChecker->isInstanceOf($parentNode, [PreInc::class, PreDec::class, PostInc::class, PostDec::class])) {
$parentNode = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
}
if (!$parent instanceof Node) {
if (!$parentNode instanceof Node) {
return \false;
}
if ($parent instanceof Arg) {
$readArg = $this->variableToConstantGuard->isReadArg($parent);
if ($parentNode instanceof Arg) {
$readArg = $this->variableToConstantGuard->isReadArg($parentNode);
if (!$readArg) {
return \true;
}
$caller = $parent->getAttribute(AttributeKey::PARENT_NODE);
$caller = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
if ($caller instanceof MethodCall || $caller instanceof StaticCall) {
return $this->isFoundByRefParam($caller);
}
}
if ($parent instanceof ArrayDimFetch) {
if ($parentNode instanceof ArrayDimFetch) {
return !$this->readWritePropertyAnalyzer->isRead($propertyFetch);
}
return \false;

View File

@ -159,8 +159,8 @@ final class VariableManipulator
}
$variableUsages = $this->collectVariableUsages($classMethod, $assign->var, $assign);
foreach ($variableUsages as $variableUsage) {
$parent = $variableUsage->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Arg && !$this->variableToConstantGuard->isReadArg($parent)) {
$parentNode = $variableUsage->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Arg && !$this->variableToConstantGuard->isReadArg($parentNode)) {
return \false;
}
if (!$this->assignManipulator->isLeftPartOfAssign($variableUsage)) {

View File

@ -66,14 +66,15 @@ final class BetterNodeFinder
$this->classAnalyzer = $classAnalyzer;
}
/**
* @template T of \PhpParser\Node
* @param array<class-string<T>> $types
* @return T|null
* @template TNode of \PhpParser\Node
* @param array<class-string<TNode>> $types
* @return TNode|null
*/
public function findParentByTypes(Node $currentNode, array $types) : ?Node
{
Assert::allIsAOf($types, Node::class);
while ($currentNode = $currentNode->getAttribute(AttributeKey::PARENT_NODE)) {
/** @var \PhpParser\Node|null $currentNode */
if (!$currentNode instanceof Node) {
return null;
}
@ -93,16 +94,16 @@ final class BetterNodeFinder
public function findParentType(Node $node, string $type) : ?Node
{
Assert::isAOf($type, Node::class);
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Node) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Node) {
return null;
}
do {
if (\is_a($parent, $type, \true)) {
return $parent;
if (\is_a($parentNode, $type, \true)) {
return $parentNode;
}
$parent = $parent->getAttribute(AttributeKey::PARENT_NODE);
} while ($parent instanceof Node);
$parentNode = $parentNode->getAttribute(AttributeKey::PARENT_NODE);
} while ($parentNode instanceof Node);
return null;
}
/**
@ -295,12 +296,12 @@ final class BetterNodeFinder
if ($foundNode instanceof Node) {
return $foundNode;
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof FunctionLike) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof FunctionLike) {
return null;
}
if ($parent instanceof Node) {
return $this->findFirstPrevious($parent, $filter);
if ($parentNode instanceof Node) {
return $this->findFirstPrevious($parentNode, $filter);
}
return null;
}
@ -320,26 +321,26 @@ final class BetterNodeFinder
*/
public function findFirstNext(Node $node, callable $filter) : ?Node
{
$next = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($next instanceof Node) {
if ($next instanceof Return_ && $next->expr === null) {
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parent instanceof Case_) {
$nextNode = $node->getAttribute(AttributeKey::NEXT_NODE);
if ($nextNode instanceof Node) {
if ($nextNode instanceof Return_ && $nextNode->expr === null) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if (!$parentNode instanceof Case_) {
return null;
}
}
$found = $this->findFirst($next, $filter);
$found = $this->findFirst($nextNode, $filter);
if ($found instanceof Node) {
return $found;
}
return $this->findFirstNext($next, $filter);
return $this->findFirstNext($nextNode, $filter);
}
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parent instanceof Return_ || $parent instanceof FunctionLike) {
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
if ($parentNode instanceof Return_ || $parentNode instanceof FunctionLike) {
return null;
}
if ($parent instanceof Node) {
return $this->findFirstNext($parent, $filter);
if ($parentNode instanceof Node) {
return $this->findFirstNext($parentNode, $filter);
}
return null;
}
@ -460,6 +461,7 @@ final class BetterNodeFinder
if ($currentStmt instanceof Stmt) {
return $currentStmt;
}
/** @var Node|null $currentStmt */
if (!$currentStmt instanceof Node) {
return null;
}

View File

@ -123,11 +123,11 @@ final class PropertyFetchFinder
*/
private function isInAnonymous(PropertyFetch $propertyFetch, $class, bool $hasTrait) : bool
{
$parent = $this->betterNodeFinder->findParentType($propertyFetch, Class_::class);
if (!$parent instanceof Class_) {
$parentNode = $this->betterNodeFinder->findParentType($propertyFetch, Class_::class);
if (!$parentNode instanceof Class_) {
return \false;
}
return $parent !== $class && !$hasTrait;
return $parentNode !== $class && !$hasTrait;
}
/**
* @param \PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\Trait_ $class

View File

@ -12,6 +12,7 @@ use PhpParser\Node\Stmt\Nop;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\ParentConnectingVisitor;
use PhpParser\NodeVisitorAbstract;
use PHPStan\Analyser\MutatingScope;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
@ -231,6 +232,7 @@ CODE_SAMPLE;
$refactoredNode->setAttribute(AttributeKey::PARENT_NODE, $node->getAttribute(AttributeKey::PARENT_NODE));
$this->connectParentNodes($refactoredNode);
}
/** @var MutatingScope $currentScope */
$currentScope = $originalNode->getAttribute(AttributeKey::SCOPE);
$this->changedNodeScopeRefresher->refresh($refactoredNode, $currentScope, $this->file->getSmartFileInfo());
// is equals node type? return node early

View File

@ -4,6 +4,7 @@ declare (strict_types=1);
namespace Rector\Core\Rector;
use PhpParser\Node;
use PHPStan\Analyser\MutatingScope;
use PHPStan\Analyser\Scope;
use Rector\Core\Contract\Rector\ScopeAwarePhpRectorInterface;
use Rector\Core\Exception\ShouldNotHappenException;
@ -35,6 +36,7 @@ abstract class AbstractScopeAwareRector extends \Rector\Core\Rector\AbstractRect
*/
public function refactor(Node $node)
{
/** @var MutatingScope|null $scope */
$scope = $node->getAttribute(AttributeKey::SCOPE);
if ($this->scopeAnalyzer->isScopeResolvableFromFile($node, $scope)) {
$smartFileInfo = $this->file->getSmartFileInfo();
@ -42,8 +44,8 @@ abstract class AbstractScopeAwareRector extends \Rector\Core\Rector\AbstractRect
$this->changedNodeScopeRefresher->refresh($node, $scope, $smartFileInfo);
}
if (!$scope instanceof Scope) {
$parent = $node->getAttribute(AttributeKey::PARENT_NODE);
$errorMessage = \sprintf('Scope not available on "%s" node with parent node of "%s", but is required by a refactorWithScope() method of "%s" rule. Fix scope refresh on changed nodes first', \get_class($node), \get_class($parent), static::class);
$parentNode = $node->getAttribute(AttributeKey::PARENT_NODE);
$errorMessage = \sprintf('Scope not available on "%s" node with parent node of "%s", but is required by a refactorWithScope() method of "%s" rule. Fix scope refresh on changed nodes first', \get_class($node), $parentNode instanceof \PhpParser\Node ? \get_class($parentNode) : 'unknown node', static::class);
throw new ShouldNotHappenException($errorMessage);
}
return $this->refactorWithScope($node, $scope);

View File

@ -22,6 +22,7 @@ use PHPStan\Reflection\Php\PhpPropertyReflection;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Type\TypeUtils;
use PHPStan\Type\TypeWithClassName;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\NodeAnalyzer\ClassAnalyzer;
use Rector\Core\PhpParser\AstResolver;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
@ -89,7 +90,11 @@ final class ReflectionResolver
public function resolveClassAndAnonymousClass(ClassLike $classLike) : ClassReflection
{
if ($classLike instanceof Class_ && $this->classAnalyzer->isAnonymousClass($classLike)) {
return $this->reflectionProvider->getAnonymousClassReflection($classLike, $classLike->getAttribute(AttributeKey::SCOPE));
$classLikeScope = $classLike->getAttribute(AttributeKey::SCOPE);
if (!$classLikeScope instanceof Scope) {
throw new ShouldNotHappenException();
}
return $this->reflectionProvider->getAnonymousClassReflection($classLike, $classLikeScope);
}
$className = (string) $this->nodeNameResolver->getName($classLike);
return $this->reflectionProvider->getClass($className);

2
vendor/autoload.php vendored
View File

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

View File

@ -20,6 +20,8 @@ return array(
'PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstFetchNode' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstFetchNode.php',
'PHPStan\\PhpDocParser\\Ast\\Node' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/Node.php',
'PHPStan\\PhpDocParser\\Ast\\NodeAttributes' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\AssertTagMethodValueNode' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\AssertTagPropertyValueNode' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\AssertTagValueNode' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\DeprecatedTagValueNode' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\ExtendsTagValueNode' => $vendorDir . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit841e17c63cc75b4d335e0be48bb8e992
class ComposerAutoloaderInitc6497ac34cfe48ccc1ccb017402f115b
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit841e17c63cc75b4d335e0be48bb8e992
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit841e17c63cc75b4d335e0be48bb8e992', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc6497ac34cfe48ccc1ccb017402f115b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit841e17c63cc75b4d335e0be48bb8e992', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc6497ac34cfe48ccc1ccb017402f115b', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitc6497ac34cfe48ccc1ccb017402f115b::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInitc6497ac34cfe48ccc1ccb017402f115b::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire841e17c63cc75b4d335e0be48bb8e992($fileIdentifier, $file);
composerRequirec6497ac34cfe48ccc1ccb017402f115b($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit841e17c63cc75b4d335e0be48bb8e992
* @param string $file
* @return void
*/
function composerRequire841e17c63cc75b4d335e0be48bb8e992($fileIdentifier, $file)
function composerRequirec6497ac34cfe48ccc1ccb017402f115b($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 ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992
class ComposerStaticInitc6497ac34cfe48ccc1ccb017402f115b
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -326,6 +326,8 @@ class ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992
'PHPStan\\PhpDocParser\\Ast\\ConstExpr\\ConstFetchNode' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstFetchNode.php',
'PHPStan\\PhpDocParser\\Ast\\Node' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/Node.php',
'PHPStan\\PhpDocParser\\Ast\\NodeAttributes' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\AssertTagMethodValueNode' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\AssertTagPropertyValueNode' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\AssertTagValueNode' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\DeprecatedTagValueNode' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php',
'PHPStan\\PhpDocParser\\Ast\\PhpDoc\\ExtendsTagValueNode' => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php',
@ -3304,9 +3306,9 @@ class ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit841e17c63cc75b4d335e0be48bb8e992::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitc6497ac34cfe48ccc1ccb017402f115b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc6497ac34cfe48ccc1ccb017402f115b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc6497ac34cfe48ccc1ccb017402f115b::$classMap;
}, null, ClassLoader::class);
}

View File

@ -684,17 +684,17 @@
},
{
"name": "phpstan\/phpdoc-parser",
"version": "1.6.4",
"version_normalized": "1.6.4.0",
"version": "1.7.0",
"version_normalized": "1.7.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpdoc-parser.git",
"reference": "135607f9ccc297d6923d49c2bcf309f509413215"
"reference": "367a8d9d5f7da2a0136422d27ce8840583926955"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/135607f9ccc297d6923d49c2bcf309f509413215",
"reference": "135607f9ccc297d6923d49c2bcf309f509413215",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpdoc-parser\/zipball\/367a8d9d5f7da2a0136422d27ce8840583926955",
"reference": "367a8d9d5f7da2a0136422d27ce8840583926955",
"shasum": ""
},
"require": {
@ -709,7 +709,7 @@
"phpunit\/phpunit": "^9.5",
"symfony\/process": "^5.2"
},
"time": "2022-06-26T13:09:08+00:00",
"time": "2022-08-09T12:23:23+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -726,7 +726,7 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpdoc-parser\/issues",
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.6.4"
"source": "https:\/\/github.com\/phpstan\/phpdoc-parser\/tree\/1.7.0"
},
"install-path": "..\/phpstan\/phpdoc-parser"
},
@ -1988,12 +1988,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-generator.git",
"reference": "0e86e69a8e816746b2470abf48f6e2f88b2f7ef4"
"reference": "38440b9580b6b1d8859bfb72849753b241a1e39a"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-generator\/zipball\/0e86e69a8e816746b2470abf48f6e2f88b2f7ef4",
"reference": "0e86e69a8e816746b2470abf48f6e2f88b2f7ef4",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-generator\/zipball\/38440b9580b6b1d8859bfb72849753b241a1e39a",
"reference": "38440b9580b6b1d8859bfb72849753b241a1e39a",
"shasum": ""
},
"require": {
@ -2003,14 +2003,13 @@
"symfony\/console": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symfony\/finder": "^6.0",
"symplify\/astral": "^11.0",
"symplify\/package-builder": "^11.0"
},
"require-dev": {
"php-parallel-lint\/php-parallel-lint": "^1.3",
"phpstan\/extension-installer": "^1.1",
"phpstan\/phpdoc-parser": "^1.6",
"phpstan\/phpstan-strict-rules": "^1.2",
"phpstan\/phpdoc-parser": "^1.6.4",
"phpstan\/phpstan-strict-rules": "^1.3",
"phpstan\/phpstan-webmozart-assert": "^1.0",
"phpunit\/phpunit": "^9.5",
"rector\/rector-src": "dev-main",
@ -2022,7 +2021,7 @@
"symplify\/phpstan-rules": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-27T08:23:20+00:00",
"time": "2022-08-09T10:09:42+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2047,7 +2046,7 @@
"homepage": "https:\/\/getrector.org",
"support": {
"issues": "https:\/\/github.com\/rectorphp\/rector-generator\/issues",
"source": "https:\/\/github.com\/rectorphp\/rector-generator\/tree\/main"
"source": "https:\/\/github.com\/rectorphp\/rector-generator\/tree\/0.6.10"
},
"funding": [
{
@ -2131,16 +2130,16 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-nette.git",
"reference": "6232a290557122fc1ce405652f45cd04eb0b6204"
"reference": "0e8e9338c52b5b1a8a8dc1fc6dcd641e02a2f443"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/6232a290557122fc1ce405652f45cd04eb0b6204",
"reference": "6232a290557122fc1ce405652f45cd04eb0b6204",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/0e8e9338c52b5b1a8a8dc1fc6dcd641e02a2f443",
"reference": "0e8e9338c52b5b1a8a8dc1fc6dcd641e02a2f443",
"shasum": ""
},
"require": {
"php": ">=8.1",
"php": ">=8.0",
"rector\/rector": "^0.13.8"
},
"require-dev": {
@ -2153,16 +2152,16 @@
"phpstan\/phpstan-strict-rules": "^1.3",
"phpstan\/phpstan-webmozart-assert": "^1.2",
"phpunit\/phpunit": "^9.5",
"rector\/phpstan-rules": "^0.5",
"symplify\/easy-ci": "^11.0",
"symplify\/easy-coding-standard": "^11.0",
"symplify\/monorepo-builder": "^11.0",
"symplify\/phpstan-extensions": "^11.0",
"symplify\/phpstan-rules": "^11.0",
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
"rector\/phpstan-rules": "^0.5.12",
"symplify\/easy-ci": "^11.1",
"symplify\/easy-coding-standard": "^11.1",
"symplify\/monorepo-builder": "^11.1",
"symplify\/phpstan-extensions": "^11.1",
"symplify\/phpstan-rules": "^11.1.2",
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-08-08T19:48:49+00:00",
"time": "2022-08-09T10:12:59+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -3244,17 +3243,17 @@
},
{
"name": "symplify\/astral",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/astral.git",
"reference": "090104b5bd7f93bf2e88466e326eb10ebd2ab098"
"reference": "3bf841a98ab1313b900723071ce58cb8281beacb"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/astral\/zipball\/090104b5bd7f93bf2e88466e326eb10ebd2ab098",
"reference": "090104b5bd7f93bf2e88466e326eb10ebd2ab098",
"url": "https:\/\/api.github.com\/repos\/symplify\/astral\/zipball\/3bf841a98ab1313b900723071ce58cb8281beacb",
"reference": "3bf841a98ab1313b900723071ce58cb8281beacb",
"shasum": ""
},
"require": {
@ -3263,37 +3262,37 @@
"php": ">=8.0",
"phpstan\/phpdoc-parser": "^1.6.3",
"phpstan\/phpstan": "^1.8.1",
"symplify\/package-builder": "^11.1.1"
"symplify\/package-builder": "^11.1.2"
},
"conflict": {
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/smart-file-system": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/symplify-kernel": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/smart-file-system": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/symplify-kernel": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21",
"symfony\/config": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symplify\/easy-testing": "^11.1.1",
"symplify\/symplify-kernel": "^11.1.1"
"symplify\/easy-testing": "^11.1.2",
"symplify\/symplify-kernel": "^11.1.2"
},
"time": "2022-08-08T21:51:07+00:00",
"time": "2022-08-09T10:13:12+00:00",
"type": "phpstan-extension",
"extra": {
"branch-alias": {
@ -3317,7 +3316,7 @@
],
"description": "Toolking for smart daily work with AST",
"support": {
"source": "https:\/\/github.com\/symplify\/astral\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/astral\/tree\/11.1.2"
},
"funding": [
{
@ -3333,50 +3332,50 @@
},
{
"name": "symplify\/autowire-array-parameter",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/autowire-array-parameter.git",
"reference": "9b546258bdcc3acebbc48decb860c272c1b850db"
"reference": "5812405ad38e2538d27a62cc39797fde332653ad"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/9b546258bdcc3acebbc48decb860c272c1b850db",
"reference": "9b546258bdcc3acebbc48decb860c272c1b850db",
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/5812405ad38e2538d27a62cc39797fde332653ad",
"reference": "5812405ad38e2538d27a62cc39797fde332653ad",
"shasum": ""
},
"require": {
"nette\/utils": "^3.2",
"php": ">=8.0",
"symfony\/dependency-injection": "^6.0",
"symplify\/package-builder": "^11.1.1"
"symplify\/package-builder": "^11.1.2"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/smart-file-system": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/symplify-kernel": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/smart-file-system": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/symplify-kernel": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:51:05+00:00",
"time": "2022-08-09T10:13:13+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -3395,7 +3394,7 @@
],
"description": "Autowire array parameters for your Symfony applications",
"support": {
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/11.1.2"
},
"funding": [
{
@ -3411,17 +3410,17 @@
},
{
"name": "symplify\/composer-json-manipulator",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/composer-json-manipulator.git",
"reference": "9860fc779054de50f3be16ee43ab119728be26e4"
"reference": "5a03e3d9f6d094f6b5278f7bf4234c251a61b634"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/composer-json-manipulator\/zipball\/9860fc779054de50f3be16ee43ab119728be26e4",
"reference": "9860fc779054de50f3be16ee43ab119728be26e4",
"url": "https:\/\/api.github.com\/repos\/symplify\/composer-json-manipulator\/zipball\/5a03e3d9f6d094f6b5278f7bf4234c251a61b634",
"reference": "5a03e3d9f6d094f6b5278f7bf4234c251a61b634",
"shasum": ""
},
"require": {
@ -3430,34 +3429,34 @@
"symfony\/config": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symfony\/filesystem": "^6.0",
"symplify\/package-builder": "^11.1.1",
"symplify\/smart-file-system": "^11.1.1",
"symplify\/symplify-kernel": "^11.1.1"
"symplify\/package-builder": "^11.1.2",
"symplify\/smart-file-system": "^11.1.2",
"symplify\/symplify-kernel": "^11.1.2"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/symplify-kernel": "<9.4.70",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:51:21+00:00",
"time": "2022-08-09T10:13:28+00:00",
"type": "symfony-bundle",
"extra": {
"branch-alias": {
@ -3476,7 +3475,7 @@
],
"description": "Package to load, merge and save composer.json file(s)",
"support": {
"source": "https:\/\/github.com\/symplify\/composer-json-manipulator\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/composer-json-manipulator\/tree\/11.1.2"
},
"funding": [
{
@ -3492,17 +3491,17 @@
},
{
"name": "symplify\/easy-parallel",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/easy-parallel.git",
"reference": "5aed2b6bc0b6e78da55ba8d6aa680c365a2dfdf7"
"reference": "55be52533268a00b8326b7507d3edccf5f6af20d"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-parallel\/zipball\/5aed2b6bc0b6e78da55ba8d6aa680c365a2dfdf7",
"reference": "5aed2b6bc0b6e78da55ba8d6aa680c365a2dfdf7",
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-parallel\/zipball\/55be52533268a00b8326b7507d3edccf5f6af20d",
"reference": "55be52533268a00b8326b7507d3edccf5f6af20d",
"shasum": ""
},
"require": {
@ -3512,33 +3511,33 @@
"react\/event-loop": "^1.3",
"react\/socket": "^1.11",
"symfony\/console": "^6.0",
"symplify\/package-builder": "^11.1.1"
"symplify\/package-builder": "^11.1.2"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/smart-file-system": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/symplify-kernel": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/smart-file-system": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/symplify-kernel": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:51:29+00:00",
"time": "2022-08-09T10:13:20+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -3558,23 +3557,23 @@
"description": "Helper package for easier CLI project parallelization",
"support": {
"issues": "https:\/\/github.com\/symplify\/easy-parallel\/issues",
"source": "https:\/\/github.com\/symplify\/easy-parallel\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/easy-parallel\/tree\/11.1.2"
},
"install-path": "..\/symplify\/easy-parallel"
},
{
"name": "symplify\/easy-testing",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/easy-testing.git",
"reference": "36e1d706cec3fdd9b6c5f1240b8795a82f162fd6"
"reference": "13ce0a44e75226d9febbfe4219d4cbee3a1f9625"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-testing\/zipball\/36e1d706cec3fdd9b6c5f1240b8795a82f162fd6",
"reference": "36e1d706cec3fdd9b6c5f1240b8795a82f162fd6",
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-testing\/zipball\/13ce0a44e75226d9febbfe4219d4cbee3a1f9625",
"reference": "13ce0a44e75226d9febbfe4219d4cbee3a1f9625",
"shasum": ""
},
"require": {
@ -3583,33 +3582,33 @@
"symfony\/console": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symfony\/finder": "^6.0",
"symplify\/package-builder": "^11.1.1",
"symplify\/smart-file-system": "^11.1.1",
"symplify\/symplify-kernel": "^11.1.1"
"symplify\/package-builder": "^11.1.2",
"symplify\/smart-file-system": "^11.1.2",
"symplify\/symplify-kernel": "^11.1.2"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:51:40+00:00",
"time": "2022-08-09T10:13:14+00:00",
"bin": [
"bin\/easy-testing"
],
@ -3631,7 +3630,7 @@
],
"description": "Testing made easy",
"support": {
"source": "https:\/\/github.com\/symplify\/easy-testing\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/easy-testing\/tree\/11.1.2"
},
"funding": [
{
@ -3647,17 +3646,17 @@
},
{
"name": "symplify\/package-builder",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/package-builder.git",
"reference": "b9c105155eb435e0b70c03d0cd206795dbe2b2c9"
"reference": "7494e2d0db712770c1201dd26587c8f7989d36b3"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/b9c105155eb435e0b70c03d0cd206795dbe2b2c9",
"reference": "b9c105155eb435e0b70c03d0cd206795dbe2b2c9",
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/7494e2d0db712770c1201dd26587c8f7989d36b3",
"reference": "7494e2d0db712770c1201dd26587c8f7989d36b3",
"shasum": ""
},
"require": {
@ -3668,33 +3667,33 @@
"symfony\/console": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symfony\/finder": "^6.0",
"symplify\/easy-testing": "^11.1.1",
"symplify\/symplify-kernel": "^11.1.1"
"symplify\/easy-testing": "^11.1.2",
"symplify\/symplify-kernel": "^11.1.2"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/smart-file-system": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/smart-file-system": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:51:43+00:00",
"time": "2022-08-09T10:13:30+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -3713,7 +3712,7 @@
],
"description": "Dependency Injection, Console and Kernel toolkit for Symplify packages.",
"support": {
"source": "https:\/\/github.com\/symplify\/package-builder\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/package-builder\/tree\/11.1.2"
},
"funding": [
{
@ -3729,17 +3728,17 @@
},
{
"name": "symplify\/rule-doc-generator-contracts",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts.git",
"reference": "7efdf6b204b962a266d09bce9afbc0c789ad8e27"
"reference": "20b64e68bd935881edd2d1a3845cfb1763fe20ac"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/rule-doc-generator-contracts\/zipball\/7efdf6b204b962a266d09bce9afbc0c789ad8e27",
"reference": "7efdf6b204b962a266d09bce9afbc0c789ad8e27",
"url": "https:\/\/api.github.com\/repos\/symplify\/rule-doc-generator-contracts\/zipball\/20b64e68bd935881edd2d1a3845cfb1763fe20ac",
"reference": "20b64e68bd935881edd2d1a3845cfb1763fe20ac",
"shasum": ""
},
"require": {
@ -3747,28 +3746,28 @@
"php": ">=8.0"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/package-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/smart-file-system": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/symplify-kernel": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/package-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/smart-file-system": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/symplify-kernel": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"time": "2022-08-08T21:52:12+00:00",
"time": "2022-08-09T10:13:33+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -3787,7 +3786,7 @@
],
"description": "Contracts for production code of RuleDocGenerator",
"support": {
"source": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts\/tree\/11.1.2"
},
"funding": [
{
@ -3803,17 +3802,17 @@
},
{
"name": "symplify\/skipper",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/skipper.git",
"reference": "2901650942500178b3dc40cf6dcb7a1aa17fac94"
"reference": "4676bf4dfca104420000eee7db2e2dde71b3ae89"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/skipper\/zipball\/2901650942500178b3dc40cf6dcb7a1aa17fac94",
"reference": "2901650942500178b3dc40cf6dcb7a1aa17fac94",
"url": "https:\/\/api.github.com\/repos\/symplify\/skipper\/zipball\/4676bf4dfca104420000eee7db2e2dde71b3ae89",
"reference": "4676bf4dfca104420000eee7db2e2dde71b3ae89",
"shasum": ""
},
"require": {
@ -3823,33 +3822,33 @@
"symfony\/dependency-injection": "^6.0",
"symfony\/filesystem": "^6.0",
"symfony\/finder": "^6.0",
"symplify\/package-builder": "^11.1.1",
"symplify\/smart-file-system": "^11.1.1",
"symplify\/symplify-kernel": "^11.1.1"
"symplify\/package-builder": "^11.1.2",
"symplify\/smart-file-system": "^11.1.2",
"symplify\/symplify-kernel": "^11.1.2"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:52:37+00:00",
"time": "2022-08-09T10:13:52+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -3868,7 +3867,7 @@
],
"description": "Skip files by rule class, directory, file or fnmatch",
"support": {
"source": "https:\/\/github.com\/symplify\/skipper\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/skipper\/tree\/11.1.2"
},
"funding": [
{
@ -3884,17 +3883,17 @@
},
{
"name": "symplify\/smart-file-system",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/smart-file-system.git",
"reference": "be9737cb9d826a4c2f71386cdca869219354be87"
"reference": "e6ce161392db2086919d893ba58eaae41c1089df"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/smart-file-system\/zipball\/be9737cb9d826a4c2f71386cdca869219354be87",
"reference": "be9737cb9d826a4c2f71386cdca869219354be87",
"url": "https:\/\/api.github.com\/repos\/symplify\/smart-file-system\/zipball\/e6ce161392db2086919d893ba58eaae41c1089df",
"reference": "e6ce161392db2086919d893ba58eaae41c1089df",
"shasum": ""
},
"require": {
@ -3904,32 +3903,32 @@
"symfony\/finder": "^6.0"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/autowire-array-parameter": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/composer-json-manipulator": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/package-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/symplify-kernel": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/autowire-array-parameter": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/composer-json-manipulator": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/package-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/symplify-kernel": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"nette\/finder": "^2.5.3",
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:52:25+00:00",
"time": "2022-08-09T10:13:37+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -3948,7 +3947,7 @@
],
"description": "Sanitized FileInfo with safe getRealPath() and other handy methods",
"support": {
"source": "https:\/\/github.com\/symplify\/smart-file-system\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/smart-file-system\/tree\/11.1.2"
},
"funding": [
{
@ -3964,51 +3963,51 @@
},
{
"name": "symplify\/symplify-kernel",
"version": "11.1.1",
"version_normalized": "11.1.1.0",
"version": "11.1.2",
"version_normalized": "11.1.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symplify\/symplify-kernel.git",
"reference": "46d8d4109b20c8e89c103437609148d24fe0ae59"
"reference": "93d65a773fca1f5652d20399306f5d0029af6626"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symplify\/symplify-kernel\/zipball\/46d8d4109b20c8e89c103437609148d24fe0ae59",
"reference": "46d8d4109b20c8e89c103437609148d24fe0ae59",
"url": "https:\/\/api.github.com\/repos\/symplify\/symplify-kernel\/zipball\/93d65a773fca1f5652d20399306f5d0029af6626",
"reference": "93d65a773fca1f5652d20399306f5d0029af6626",
"shasum": ""
},
"require": {
"php": ">=8.0",
"symfony\/console": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symplify\/autowire-array-parameter": "^11.1.1",
"symplify\/composer-json-manipulator": "^11.1.1",
"symplify\/package-builder": "^11.1.1",
"symplify\/smart-file-system": "^11.1.1",
"symplify\/autowire-array-parameter": "^11.1.2",
"symplify\/composer-json-manipulator": "^11.1.2",
"symplify\/package-builder": "^11.1.2",
"symplify\/smart-file-system": "^11.1.2",
"webmozart\/assert": "^1.10"
},
"conflict": {
"symplify\/astral": "<11.1.1",
"symplify\/coding-standard": "<11.1.1",
"symplify\/config-transformer": "<11.1.1",
"symplify\/easy-ci": "<11.1.1",
"symplify\/easy-coding-standard": "<11.1.1",
"symplify\/easy-parallel": "<11.1.1",
"symplify\/easy-testing": "<11.1.1",
"symplify\/monorepo-builder": "<11.1.1",
"symplify\/php-config-printer": "<11.1.1",
"symplify\/phpstan-extensions": "<11.1.1",
"symplify\/phpstan-rules": "<11.1.1",
"symplify\/rule-doc-generator": "<11.1.1",
"symplify\/rule-doc-generator-contracts": "<11.1.1",
"symplify\/skipper": "<11.1.1",
"symplify\/symfony-static-dumper": "<11.1.1",
"symplify\/vendor-patches": "<11.1.1"
"symplify\/astral": "<11.1.2",
"symplify\/coding-standard": "<11.1.2",
"symplify\/config-transformer": "<11.1.2",
"symplify\/easy-ci": "<11.1.2",
"symplify\/easy-coding-standard": "<11.1.2",
"symplify\/easy-parallel": "<11.1.2",
"symplify\/easy-testing": "<11.1.2",
"symplify\/monorepo-builder": "<11.1.2",
"symplify\/php-config-printer": "<11.1.2",
"symplify\/phpstan-extensions": "<11.1.2",
"symplify\/phpstan-rules": "<11.1.2",
"symplify\/rule-doc-generator": "<11.1.2",
"symplify\/rule-doc-generator-contracts": "<11.1.2",
"symplify\/skipper": "<11.1.2",
"symplify\/symfony-static-dumper": "<11.1.2",
"symplify\/vendor-patches": "<11.1.2"
},
"require-dev": {
"phpunit\/phpunit": "^9.5.21"
},
"time": "2022-08-08T21:52:30+00:00",
"time": "2022-08-09T10:13:34+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -4027,7 +4026,7 @@
],
"description": "Internal Kernel for Symplify packages",
"support": {
"source": "https:\/\/github.com\/symplify\/symplify-kernel\/tree\/11.1.1"
"source": "https:\/\/github.com\/symplify\/symplify-kernel\/tree\/11.1.2"
},
"install-path": "..\/symplify\/symplify-kernel"
},

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
<?php
declare (strict_types=1);
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
use PHPStan\PhpDocParser\Ast\NodeAttributes;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use function trim;
class AssertTagMethodValueNode implements \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode
{
use NodeAttributes;
/** @var TypeNode */
public $type;
/** @var string */
public $parameter;
/** @var string */
public $method;
/** @var bool */
public $isNegated;
/** @var string (may be empty) */
public $description;
public function __construct(TypeNode $type, string $parameter, string $method, bool $isNegated, string $description)
{
$this->type = $type;
$this->parameter = $parameter;
$this->method = $method;
$this->isNegated = $isNegated;
$this->description = $description;
}
public function __toString() : string
{
$isNegated = $this->isNegated ? '!' : '';
return trim("{$this->type} {$isNegated}{$this->parameter}->{$this->method}() {$this->description}");
}
}

View File

@ -0,0 +1,35 @@
<?php
declare (strict_types=1);
namespace PHPStan\PhpDocParser\Ast\PhpDoc;
use PHPStan\PhpDocParser\Ast\NodeAttributes;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use function trim;
class AssertTagPropertyValueNode implements \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode
{
use NodeAttributes;
/** @var TypeNode */
public $type;
/** @var string */
public $parameter;
/** @var string */
public $property;
/** @var bool */
public $isNegated;
/** @var string (may be empty) */
public $description;
public function __construct(TypeNode $type, string $parameter, string $property, bool $isNegated, string $description)
{
$this->type = $type;
$this->parameter = $parameter;
$this->property = $property;
$this->isNegated = $isNegated;
$this->description = $description;
}
public function __toString() : string
{
$isNegated = $this->isNegated ? '!' : '';
return trim("{$this->type} {$isNegated}{$this->parameter}->{$this->property} {$this->description}");
}
}

View File

@ -201,6 +201,24 @@ class PhpDocNode implements Node
return $value instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\AssertTagValueNode;
});
}
/**
* @return AssertTagPropertyValueNode[]
*/
public function getAssertPropertyTagValues(string $tagName = '@phpstan-assert') : array
{
return array_filter(array_column($this->getTagsByName($tagName), 'value'), static function (\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode $value) : bool {
return $value instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\AssertTagPropertyValueNode;
});
}
/**
* @return AssertTagMethodValueNode[]
*/
public function getAssertMethodTagValues(string $tagName = '@phpstan-assert') : array
{
return array_filter(array_column($this->getTagsByName($tagName), 'value'), static function (\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode $value) : bool {
return $value instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\AssertTagMethodValueNode;
});
}
public function __toString() : string
{
$children = array_map(static function (\PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocChildNode $child) : string {

View File

@ -45,7 +45,8 @@ class Lexer
public const TOKEN_OPEN_CURLY_BRACKET = 31;
public const TOKEN_CLOSE_CURLY_BRACKET = 32;
public const TOKEN_NEGATED = 33;
public const TOKEN_LABELS = [self::TOKEN_REFERENCE => '\'&\'', self::TOKEN_UNION => '\'|\'', self::TOKEN_INTERSECTION => '\'&\'', self::TOKEN_NULLABLE => '\'?\'', self::TOKEN_NEGATED => '\'!\'', self::TOKEN_OPEN_PARENTHESES => '\'(\'', self::TOKEN_CLOSE_PARENTHESES => '\')\'', self::TOKEN_OPEN_ANGLE_BRACKET => '\'<\'', self::TOKEN_CLOSE_ANGLE_BRACKET => '\'>\'', self::TOKEN_OPEN_SQUARE_BRACKET => '\'[\'', self::TOKEN_CLOSE_SQUARE_BRACKET => '\']\'', self::TOKEN_OPEN_CURLY_BRACKET => '\'{\'', self::TOKEN_CLOSE_CURLY_BRACKET => '\'}\'', self::TOKEN_COMMA => '\',\'', self::TOKEN_COLON => '\':\'', self::TOKEN_VARIADIC => '\'...\'', self::TOKEN_DOUBLE_COLON => '\'::\'', self::TOKEN_DOUBLE_ARROW => '\'=>\'', self::TOKEN_EQUAL => '\'=\'', self::TOKEN_OPEN_PHPDOC => '\'/**\'', self::TOKEN_CLOSE_PHPDOC => '\'*/\'', self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', self::TOKEN_FLOAT => 'TOKEN_FLOAT', self::TOKEN_INTEGER => 'TOKEN_INTEGER', self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', self::TOKEN_IDENTIFIER => 'type', self::TOKEN_THIS_VARIABLE => '\'$this\'', self::TOKEN_VARIABLE => 'variable', self::TOKEN_HORIZONTAL_WS => 'TOKEN_HORIZONTAL_WS', self::TOKEN_OTHER => 'TOKEN_OTHER', self::TOKEN_END => 'TOKEN_END', self::TOKEN_WILDCARD => '*'];
public const TOKEN_ARROW = 34;
public const TOKEN_LABELS = [self::TOKEN_REFERENCE => '\'&\'', self::TOKEN_UNION => '\'|\'', self::TOKEN_INTERSECTION => '\'&\'', self::TOKEN_NULLABLE => '\'?\'', self::TOKEN_NEGATED => '\'!\'', self::TOKEN_OPEN_PARENTHESES => '\'(\'', self::TOKEN_CLOSE_PARENTHESES => '\')\'', self::TOKEN_OPEN_ANGLE_BRACKET => '\'<\'', self::TOKEN_CLOSE_ANGLE_BRACKET => '\'>\'', self::TOKEN_OPEN_SQUARE_BRACKET => '\'[\'', self::TOKEN_CLOSE_SQUARE_BRACKET => '\']\'', self::TOKEN_OPEN_CURLY_BRACKET => '\'{\'', self::TOKEN_CLOSE_CURLY_BRACKET => '\'}\'', self::TOKEN_COMMA => '\',\'', self::TOKEN_COLON => '\':\'', self::TOKEN_VARIADIC => '\'...\'', self::TOKEN_DOUBLE_COLON => '\'::\'', self::TOKEN_DOUBLE_ARROW => '\'=>\'', self::TOKEN_ARROW => '\'->\'', self::TOKEN_EQUAL => '\'=\'', self::TOKEN_OPEN_PHPDOC => '\'/**\'', self::TOKEN_CLOSE_PHPDOC => '\'*/\'', self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', self::TOKEN_FLOAT => 'TOKEN_FLOAT', self::TOKEN_INTEGER => 'TOKEN_INTEGER', self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', self::TOKEN_IDENTIFIER => 'type', self::TOKEN_THIS_VARIABLE => '\'$this\'', self::TOKEN_VARIABLE => 'variable', self::TOKEN_HORIZONTAL_WS => 'TOKEN_HORIZONTAL_WS', self::TOKEN_OTHER => 'TOKEN_OTHER', self::TOKEN_END => 'TOKEN_END', self::TOKEN_WILDCARD => '*'];
public const VALUE_OFFSET = 0;
public const TYPE_OFFSET = 1;
/** @var string|null */
@ -88,6 +89,7 @@ class Lexer
self::TOKEN_VARIADIC => '\\.\\.\\.',
self::TOKEN_DOUBLE_COLON => '::',
self::TOKEN_DOUBLE_ARROW => '=>',
self::TOKEN_ARROW => '->',
self::TOKEN_EQUAL => '=',
self::TOKEN_COLON => ':',
self::TOKEN_OPEN_PHPDOC => '/\\*\\*(?=\\s)\\x20?+',

View File

@ -7,6 +7,7 @@ use PHPStan\PhpDocParser\Ast;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use PHPStan\PhpDocParser\Lexer\Lexer;
use PHPStan\ShouldNotHappenException;
use function array_key_exists;
use function array_values;
use function count;
use function trim;
@ -341,13 +342,47 @@ class PhpDocParser
}
return new Ast\PhpDoc\TypeAliasImportTagValueNode($importedAlias, new IdentifierTypeNode($importedFrom), $importedAs);
}
private function parseAssertTagValue(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens) : Ast\PhpDoc\AssertTagValueNode
/**
* @return Ast\PhpDoc\AssertTagValueNode|Ast\PhpDoc\AssertTagPropertyValueNode|Ast\PhpDoc\AssertTagMethodValueNode
*/
private function parseAssertTagValue(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens) : Ast\PhpDoc\PhpDocTagValueNode
{
$isNegated = $tokens->tryConsumeTokenType(Lexer::TOKEN_NEGATED);
$type = $this->typeParser->parse($tokens);
$parameter = $this->parseRequiredVariableName($tokens);
$parameter = $this->parseAssertParameter($tokens);
$description = $this->parseOptionalDescription($tokens);
return new Ast\PhpDoc\AssertTagValueNode($type, $parameter, $isNegated, $description);
if (array_key_exists('method', $parameter)) {
return new Ast\PhpDoc\AssertTagMethodValueNode($type, $parameter['parameter'], $parameter['method'], $isNegated, $description);
} elseif (array_key_exists('property', $parameter)) {
return new Ast\PhpDoc\AssertTagPropertyValueNode($type, $parameter['parameter'], $parameter['property'], $isNegated, $description);
}
return new Ast\PhpDoc\AssertTagValueNode($type, $parameter['parameter'], $isNegated, $description);
}
/**
* @return array{parameter: string}|array{parameter: string, property: string}|array{parameter: string, method: string}
*/
private function parseAssertParameter(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens) : array
{
if ($tokens->isCurrentTokenType(Lexer::TOKEN_THIS_VARIABLE)) {
$parameter = '$this';
$requirePropertyOrMethod = \true;
$tokens->next();
} else {
$parameter = $tokens->currentTokenValue();
$requirePropertyOrMethod = \false;
$tokens->consumeTokenType(Lexer::TOKEN_VARIABLE);
}
if ($requirePropertyOrMethod || $tokens->isCurrentTokenType(Lexer::TOKEN_ARROW)) {
$tokens->consumeTokenType(Lexer::TOKEN_ARROW);
$propertyOrMethod = $tokens->currentTokenValue();
$tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER);
if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) {
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES);
return ['parameter' => $parameter, 'method' => $propertyOrMethod];
}
return ['parameter' => $parameter, 'property' => $propertyOrMethod];
}
return ['parameter' => $parameter];
}
private function parseOptionalVariableName(\PHPStan\PhpDocParser\Parser\TokenIterator $tokens) : string
{

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' => 'dev-main ec96616'), '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' => 'dev-main 3e935b4'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 7ee4e58'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0e86e69'), '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' => 'dev-main 987bdb4'), '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' => 'dev-main 6232a29'), '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' => 'dev-main ad7cfce'), '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' => 'dev-main d876ff2'), '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' => 'dev-main f88fb13'));
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' => 'dev-main ec96616'), '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' => 'dev-main 3e935b4'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 7ee4e58'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 38440b9'), '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' => 'dev-main 987bdb4'), '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' => 'dev-main 0e8e933'), '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' => 'dev-main ad7cfce'), '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' => 'dev-main d876ff2'), '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' => 'dev-main f88fb13'));
private function __construct()
{
}

View File

@ -11,14 +11,13 @@
"symfony\/console": "^6.0",
"symfony\/dependency-injection": "^6.0",
"symfony\/finder": "^6.0",
"symplify\/astral": "^11.0",
"symplify\/package-builder": "^11.0"
},
"require-dev": {
"rector\/rector-src": "dev-main",
"php-parallel-lint\/php-parallel-lint": "^1.3",
"phpunit\/phpunit": "^9.5",
"phpstan\/phpdoc-parser": "^1.6",
"phpstan\/phpdoc-parser": "^1.6.4",
"symplify\/coding-standard": "^11.0",
"symplify\/easy-coding-standard": "^11.0",
"symplify\/phpstan-extensions": "^11.0",
@ -27,7 +26,7 @@
"phpstan\/extension-installer": "^1.1",
"symplify\/monorepo-builder": "^11.0",
"symplify\/vendor-patches": "^11.0",
"phpstan\/phpstan-strict-rules": "^1.2",
"phpstan\/phpstan-strict-rules": "^1.3",
"phpstan\/phpstan-webmozart-assert": "^1.0"
},
"autoload": {

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace Rector\RectorGenerator\NodeFactory;
use PhpParser\Builder\Method;
use PhpParser\BuilderHelpers;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
@ -14,8 +15,6 @@ use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Property;
use RectorPrefix202208\Symplify\Astral\ValueObject\NodeBuilder\MethodBuilder;
use RectorPrefix202208\Symplify\Astral\ValueObject\NodeBuilder\PropertyBuilder;
final class NodeFactory
{
/**
@ -46,13 +45,13 @@ final class NodeFactory
}
public function createPublicMethod(string $methodName) : ClassMethod
{
$methodBuilder = new MethodBuilder($methodName);
$methodBuilder = new Method($methodName);
$methodBuilder->makePublic();
return $methodBuilder->getNode();
}
public function createPrivateArrayProperty(string $propertyName) : Property
{
$propertyBuilder = new PropertyBuilder($propertyName);
$propertyBuilder = new \PhpParser\Builder\Property($propertyName);
$propertyBuilder->makePrivate();
$docContent = <<<'CODE_SAMPLE'
/**

View File

@ -4,27 +4,27 @@
"license": "MIT",
"description": "Rector upgrades rules for Nette Framework",
"require": {
"php": ">=8.1",
"php": ">=8.0",
"rector\/rector": "^0.13.8"
},
"require-dev": {
"phpunit\/phpunit": "^9.5",
"symplify\/phpstan-extensions": "^11.0",
"symplify\/phpstan-rules": "^11.0",
"symplify\/easy-coding-standard": "^11.0",
"symplify\/monorepo-builder": "^11.0",
"symplify\/phpstan-extensions": "^11.1",
"rector\/phpstan-rules": "^0.5.12",
"symplify\/phpstan-rules": "^11.1.2",
"symplify\/easy-coding-standard": "^11.1",
"symplify\/monorepo-builder": "^11.1",
"phpstan\/phpstan": "^1.8",
"phpstan\/phpstan-nette": "^1.0",
"nette\/application": "^3.1",
"nette\/di": "^3.0",
"nette\/forms": "3.0.*",
"symplify\/rule-doc-generator": "^11.0",
"symplify\/rule-doc-generator": "^11.1",
"phpstan\/extension-installer": "^1.1",
"rector\/phpstan-rules": "^0.5",
"phpstan\/phpstan-webmozart-assert": "^1.2",
"phpstan\/phpstan-strict-rules": "^1.3",
"symplify\/vendor-patches": "^11.0",
"symplify\/easy-ci": "^11.0"
"symplify\/vendor-patches": "^11.1",
"symplify\/easy-ci": "^11.1"
},
"autoload": {
"psr-4": {

View File

@ -18,5 +18,11 @@ return static function (RectorConfig $rectorConfig) : void {
]);
$rectorConfig->ruleWithConfiguration(StringClassNameToClassConstantRector::class, ['Nette\\*', 'Symfony\\Component\\Translation\\TranslatorInterface', 'Symfony\\Contracts\\EventDispatcher\\Event', 'Kdyby\\Events\\Subscriber']);
// needed for DEAD_CODE list, just in split package like this
$rectorConfig->sets([__DIR__ . '/config/config.php', LevelSetList::UP_TO_PHP_81, SetList::DEAD_CODE, SetList::CODE_QUALITY]);
$rectorConfig->sets([
__DIR__ . '/config/config.php',
// LevelSetList::UP_TO_PHP_80,
\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_80,
SetList::DEAD_CODE,
SetList::CODE_QUALITY,
]);
};

View File

@ -15,11 +15,9 @@ final class LatteFileProcessor implements FileProcessorInterface
{
/**
* @var LatteRectorInterface[]
* @readonly
*/
private $latteRectors;
/**
* @readonly
* @var \Rector\ChangesReporting\ValueObjectFactory\FileDiffFactory
*/
private $fileDiffFactory;

View File

@ -11,12 +11,10 @@ use Rector\NodeTypeResolver\NodeTypeResolver;
final class NetteClassAnalyzer
{
/**
* @readonly
* @var \Rector\NodeTypeResolver\NodeTypeResolver
*/
private $nodeTypeResolver;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;

View File

@ -14,12 +14,10 @@ use Rector\FamilyTree\NodeAnalyzer\ClassChildAnalyzer;
final class NetteInjectPropertyAnalyzer
{
/**
* @readonly
* @var \Rector\FamilyTree\NodeAnalyzer\ClassChildAnalyzer
*/
private $classChildAnalyzer;
/**
* @readonly
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;

View File

@ -17,32 +17,26 @@ use Rector\NodeNameResolver\NodeNameResolver;
final class PropertyUsageAnalyzer
{
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer
*/
private $familyRelationsAnalyzer;
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
/**
* @readonly
* @var \Rector\Core\PhpParser\AstResolver
*/
private $astResolver;
/**
* @readonly
* @var \Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer
*/
private $propertyFetchAnalyzer;
/**
* @readonly
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;

View File

@ -10,12 +10,10 @@ use Rector\NodeNameResolver\NodeNameResolver;
final class RenderMethodAnalyzer
{
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;

View File

@ -11,12 +11,10 @@ use Rector\NodeNestingScope\ScopeNestingComparator;
final class ReturnAnalyzer
{
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\NodeNestingScope\ScopeNestingComparator
*/
private $scopeNestingComparator;

View File

@ -10,7 +10,6 @@ use Rector\NodeNameResolver\NodeNameResolver;
final class StaticCallAnalyzer
{
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;

View File

@ -60,22 +60,18 @@ final class TemplatePropertyAssignCollector
*/
private $conditionalTemplateParameterAssigns = [];
/**
* @readonly
* @var \Rector\NodeNestingScope\ScopeNestingComparator
*/
private $scopeNestingComparator;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\ThisTemplatePropertyFetchAnalyzer
*/
private $thisTemplatePropertyFetchAnalyzer;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\ReturnAnalyzer
*/
private $returnAnalyzer;

View File

@ -11,7 +11,6 @@ use Rector\NodeNameResolver\NodeNameResolver;
final class ThisTemplatePropertyFetchAnalyzer
{
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;

View File

@ -3,13 +3,12 @@
declare (strict_types=1);
namespace Rector\Nette\NodeFactory;
use PhpParser\Builder\Class_ as ClassBuilder;
use PhpParser\Builder\Property;
use PhpParser\Builder\TraitUse;
use PhpParser\Node\NullableType;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Namespace_;
use RectorPrefix202208\Symplify\Astral\ValueObject\NodeBuilder\ClassBuilder;
use RectorPrefix202208\Symplify\Astral\ValueObject\NodeBuilder\NamespaceBuilder;
use RectorPrefix202208\Symplify\Astral\ValueObject\NodeBuilder\PropertyBuilder;
use RectorPrefix202208\Symplify\Astral\ValueObject\NodeBuilder\TraitUseBuilder;
/**
* @see \Rector\Nette\Tests\NodeFactory\ClassWithPublicPropertiesFactory\ClassWithPublicPropertiesFactoryTest
*/
@ -29,14 +28,14 @@ final class ClassWithPublicPropertiesFactory
$namespace = \implode('\\', $namespaceParts);
$namespaceBuilder = null;
if ($namespace !== '') {
$namespaceBuilder = new NamespaceBuilder($namespace);
$namespaceBuilder = new \PhpParser\Builder\Namespace_($namespace);
}
$classBuilder = new ClassBuilder($className);
if ($parent !== null && $parent !== '') {
$classBuilder->extend($this->fixFullyQualifiedName($parent));
}
foreach ($traits as $trait) {
$classBuilder->addStmt(new TraitUseBuilder($this->fixFullyQualifiedName($trait)));
$classBuilder->addStmt(new TraitUse($this->fixFullyQualifiedName($trait)));
}
foreach ($properties as $propertyName => $propertySettings) {
$propertyType = $propertySettings['type'];
@ -44,7 +43,7 @@ final class ClassWithPublicPropertiesFactory
if ($nullable) {
$propertyType = new NullableType($propertyType);
}
$propertyBuilder = new PropertyBuilder($propertyName);
$propertyBuilder = new Property($propertyName);
$propertyBuilder->setType($propertyType);
$classBuilder->addStmt($propertyBuilder);
}

View File

@ -21,12 +21,10 @@ use Rector\NodeTypeResolver\NodeTypeResolver;
final class FormFieldsFinder
{
/**
* @readonly
* @var \Rector\NodeTypeResolver\NodeTypeResolver
*/
private $nodeTypeResolver;
/**
* @readonly
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;

View File

@ -15,7 +15,6 @@ use Rector\NodeTypeResolver\NodeTypeResolver;
final class FormVariableFinder
{
/**
* @readonly
* @var \Rector\NodeTypeResolver\NodeTypeResolver
*/
private $nodeTypeResolver;

View File

@ -12,12 +12,10 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
final class ParamFinder
{
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
/**
* @readonly
* @var \Rector\Core\PhpParser\Comparing\NodeComparator
*/
private $nodeComparator;

View File

@ -16,7 +16,6 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class MergeTemplateSetFileToTemplateRenderRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\NetteClassAnalyzer
*/
private $netteClassAnalyzer;

View File

@ -42,17 +42,14 @@ final class RemoveParentAndNameFromComponentConstructorRector extends AbstractRe
*/
private $controlObjectType;
/**
* @readonly
* @var \Rector\Nette\NodeFinder\ParamFinder
*/
private $paramFinder;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\StaticCallAnalyzer
*/
private $staticCallAnalyzer;
/**
* @readonly
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;

View File

@ -28,37 +28,30 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class TemplateMagicAssignToExplicitVariableArrayRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\TemplatePropertyAssignCollector
*/
private $templatePropertyAssignCollector;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\RenderMethodAnalyzer
*/
private $renderMethodAnalyzer;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\NetteClassAnalyzer
*/
private $netteClassAnalyzer;
/**
* @readonly
* @var \Rector\Nette\NodeFactory\RenderParameterArrayFactory
*/
private $renderParameterArrayFactory;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\ConditionalTemplateAssignReplacer
*/
private $conditionalTemplateAssignReplacer;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\TemplatePropertyParametersReplacer
*/
private $templatePropertyParametersReplacer;
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\MethodCallArgMerger
*/
private $methodCallArgMerger;

View File

@ -35,12 +35,10 @@ final class TranslateClassMethodToVariadicsRector extends AbstractRector
*/
private const PARAMETERS = 'parameters';
/**
* @readonly
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;

View File

@ -39,37 +39,30 @@ final class FormDataRector extends AbstractRector implements ConfigurableRectorI
*/
private $formDataClassTraits = ['Nette\\SmartObject'];
/**
* @readonly
* @var \Rector\Nette\NodeFinder\FormVariableFinder
*/
private $formVariableFinder;
/**
* @readonly
* @var \Rector\Nette\NodeFinder\FormFieldsFinder
*/
private $formFieldsFinder;
/**
* @readonly
* @var \Rector\Nette\NodeFinder\FormOnSuccessCallbackFinder
*/
private $formOnSuccessCallbackFinder;
/**
* @readonly
* @var \Rector\Nette\NodeFinder\FormOnSuccessCallbackValuesParamFinder
*/
private $formOnSuccessCallbackValuesParamFinder;
/**
* @readonly
* @var \Rector\Nette\NodeFactory\ClassWithPublicPropertiesFactory
*/
private $classWithPublicPropertiesFactory;
/**
* @readonly
* @var \Rector\Core\Contract\PhpParser\NodePrinterInterface
*/
private $nodePrinter;
/**
* @readonly
* @var \Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector
*/
private $removedAndAddedFilesCollector;

View File

@ -23,7 +23,6 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class LatteVarTypesBasedOnPresenterTemplateParametersRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector
*/
private $removedAndAddedFilesCollector;

View File

@ -24,27 +24,22 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class MoveInjectToExistingConstructorRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\PropertyUsageAnalyzer
*/
private $propertyUsageAnalyzer;
/**
* @readonly
* @var \Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover
*/
private $phpDocTagRemover;
/**
* @readonly
* @var \Rector\PostRector\Collector\PropertyToAddCollector
*/
private $propertyToAddCollector;
/**
* @readonly
* @var \Rector\Privatization\NodeManipulator\VisibilityManipulator
*/
private $visibilityManipulator;
/**
* @readonly
* @var \Rector\Core\Php\PhpVersionProvider
*/
private $phpVersionProvider;
@ -123,7 +118,7 @@ CODE_SAMPLE
foreach ($injectProperties as $injectProperty) {
$this->removeInjectAnnotation($injectProperty);
$this->changePropertyVisibility($injectProperty);
$propertyName = $this->nodeNameResolver->getName($injectProperty);
$propertyName = $injectProperty->props[0]->name->toString();
$propertyType = $this->nodeTypeResolver->getType($injectProperty);
$propertyMetadata = new PropertyMetadata($propertyName, $propertyType, $injectProperty->flags);
$this->propertyToAddCollector->addPropertyToClass($node, $propertyMetadata);

View File

@ -38,17 +38,14 @@ final class TemplateTypeBasedOnPresenterTemplateParametersRector extends Abstrac
*/
private $templateClassTraits = [];
/**
* @readonly
* @var \Rector\Nette\NodeFactory\ClassWithPublicPropertiesFactory
*/
private $classWithPublicPropertiesFactory;
/**
* @readonly
* @var \Rector\Core\Contract\PhpParser\NodePrinterInterface
*/
private $nodePrinter;
/**
* @readonly
* @var \Rector\Core\Application\FileSystem\RemovedAndAddedFilesCollector
*/
private $removedAndAddedFilesCollector;

View File

@ -30,7 +30,6 @@ final class PregMatchFunctionToNetteUtilsStringsRector extends AbstractRector
*/
private const FUNCTION_NAME_TO_METHOD_NAME = ['preg_match' => 'match', 'preg_match_all' => 'matchAll'];
/**
* @readonly
* @var \Rector\Nette\NodeAnalyzer\PregMatchAllAnalyzer
*/
private $pregMatchAllAnalyzer;

View File

@ -15,17 +15,14 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
final class RenameMethodLatteRector implements LatteRectorInterface
{
/**
* @readonly
* @var \Rector\Renaming\Collector\MethodCallRenameCollector
*/
private $methodCallRenameCollector;
/**
* @readonly
* @var \Rector\Nette\Latte\Parser\TemplateTypeParser
*/
private $templateTypeParser;
/**
* @readonly
* @var \Rector\Nette\Latte\Parser\VarTypeParser
*/
private $varTypeParser;

Some files were not shown because too many files have changed in this diff Show More