From 9c27e517b428d7b014a2920565bce7678e6bde08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20K=C5=99=C3=AD=C5=BE?= Date: Wed, 9 May 2018 20:41:05 +0200 Subject: [PATCH] PhpDocNode: add helper method for @throws --- src/Ast/PhpDoc/PhpDocNode.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Ast/PhpDoc/PhpDocNode.php b/src/Ast/PhpDoc/PhpDocNode.php index 62912b6a..e4cdf573 100644 --- a/src/Ast/PhpDoc/PhpDocNode.php +++ b/src/Ast/PhpDoc/PhpDocNode.php @@ -84,6 +84,20 @@ public function getReturnTagValues(): array } + /** + * @return ThrowsTagValueNode[] + */ + public function getThrowsTagValues(): array + { + return array_column( + array_filter($this->getTagsByName('@throws'), function (PhpDocTagNode $tag): bool { + return $tag->value instanceof ThrowsTagValueNode; + }), + 'value' + ); + } + + /** * @return PropertyTagValueNode[] */