Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit 4300e38

Browse files
committed
update php doc parse helper
1 parent 6e4b249 commit 4300e38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PhpDoc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ class PhpDoc
2525
* - 'allow' // only allowed tags
2626
* - 'ignore' // ignored tags
2727
* - 'default' => 'description', // default tag name, first line text will attach to it.
28+
* @param array $defaults
2829
* @return array The parsed tags
2930
*/
30-
public static function getTags(string $comment, array $options = []): array
31+
public static function getTags(string $comment, array $options = [], array $defaults = []): array
3132
{
3233
if (!$comment = \trim($comment, "/ \n")) {
3334
return [];
@@ -74,7 +75,7 @@ public static function getTags(string $comment, array $options = []): array
7475
}
7576
}
7677

77-
return $tags;
78+
return $defaults ? \array_merge($defaults, $tags) :$tags;
7879
}
7980

8081
/**

0 commit comments

Comments
 (0)