Skip to content

Commit

Permalink
Also expose the tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanvelzen authored and ondrejmirtes committed May 4, 2022
1 parent 8f703ba commit 0af5cba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Ast/PhpDoc/PhpDocNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,20 @@ static function (PhpDocTagValueNode $value): bool {
}


/**
* @return AssertTagValueNode[]
*/
public function getAssertTagValues(string $tagName = '@phpstan-assert'): array
{
return array_filter(
array_column($this->getTagsByName($tagName), 'value'),
static function (PhpDocTagValueNode $value): bool {
return $value instanceof AssertTagValueNode;
}
);
}


public function __toString(): string
{
$children = array_map(
Expand Down

0 comments on commit 0af5cba

Please sign in to comment.