Skip to content

Commit 0af5cba

Browse files
rvanvelzenondrejmirtes
authored andcommitted
Also expose the tags
1 parent 8f703ba commit 0af5cba

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: src/Ast/PhpDoc/PhpDocNode.php

+14
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,20 @@ static function (PhpDocTagValueNode $value): bool {
272272
}
273273

274274

275+
/**
276+
* @return AssertTagValueNode[]
277+
*/
278+
public function getAssertTagValues(string $tagName = '@phpstan-assert'): array
279+
{
280+
return array_filter(
281+
array_column($this->getTagsByName($tagName), 'value'),
282+
static function (PhpDocTagValueNode $value): bool {
283+
return $value instanceof AssertTagValueNode;
284+
}
285+
);
286+
}
287+
288+
275289
public function __toString(): string
276290
{
277291
$children = array_map(

0 commit comments

Comments
 (0)