diff --git a/packages/BetterPhpDocParser/src/Attributes/Ast/AttributeAwareNodeFactory.php b/packages/BetterPhpDocParser/src/Attributes/Ast/AttributeAwareNodeFactory.php index f7ccc62bc2f1..3e9fdef7344c 100644 --- a/packages/BetterPhpDocParser/src/Attributes/Ast/AttributeAwareNodeFactory.php +++ b/packages/BetterPhpDocParser/src/Attributes/Ast/AttributeAwareNodeFactory.php @@ -19,6 +19,7 @@ use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTextNode; use PHPStan\PhpDocParser\Ast\PhpDoc\PropertyTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\ReturnTagValueNode; +use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\ThrowsTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode; use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode; @@ -43,6 +44,7 @@ use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\AttributeAwarePhpDocTextNode; use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\AttributeAwarePropertyTagValueNode; use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\AttributeAwareReturnTagValueNode; +use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\AttributeAwareTemplateTagValueNode; use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\AttributeAwareThrowsTagValueNode; use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\AttributeAwareVarTagValueNode; use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\Type\AttributeAwareArrayTypeNode; @@ -175,6 +177,14 @@ private function createFromPhpDocValueNode(PhpDocTagValueNode $phpDocTagValueNod return new AttributeAwareImplementsTagValueNode($typeNode, $phpDocTagValueNode->description); } + if ($phpDocTagValueNode instanceof TemplateTagValueNode) { + return new AttributeAwareTemplateTagValueNode( + $phpDocTagValueNode->name, + $phpDocTagValueNode->bound, + $phpDocTagValueNode->description + ); + } + if ($phpDocTagValueNode instanceof InvalidTagValueNode) { return new AttributeAwareInvalidTagValueNode($phpDocTagValueNode->value, $phpDocTagValueNode->exception); } diff --git a/packages/BetterPhpDocParser/src/Attributes/Ast/PhpDoc/AttributeAwareTemplateTagValueNode.php b/packages/BetterPhpDocParser/src/Attributes/Ast/PhpDoc/AttributeAwareTemplateTagValueNode.php new file mode 100644 index 000000000000..130823e389d3 --- /dev/null +++ b/packages/BetterPhpDocParser/src/Attributes/Ast/PhpDoc/AttributeAwareTemplateTagValueNode.php @@ -0,0 +1,14 @@ +