@@ -39,13 +39,9 @@ public static function getTags(string $comment, array $options = []): array
39
39
'default ' => 'description ' , // default tag name, first line text will attach to it.
40
40
], $ options );
41
41
42
- $ allow = (array )$ options ['allow ' ];
42
+ $ allow = (array )$ options ['allow ' ];
43
43
$ ignored = (array )$ options ['ignore ' ];
44
-
45
- // always allow default tag
46
- if ($ default = (string )$ options ['default ' ]) {
47
- $ allow [] = $ default ;
48
- }
44
+ $ default = (string )$ options ['default ' ];
49
45
50
46
$ comment = \str_replace ("\r\n" , "\n" , $ comment );
51
47
$ comment = "@ {$ default }\n" .
@@ -59,11 +55,12 @@ public static function getTags(string $comment, array $options = []): array
59
55
foreach ($ parts as $ part ) {
60
56
if (\preg_match ('/^(\w+)(.*)/ms ' , \trim ($ part ), $ matches )) {
61
57
$ name = $ matches [1 ];
62
- if (\in_array ($ name , $ ignored , true )) {
58
+ if (! $ name || \in_array ($ name , $ ignored , true )) {
63
59
continue ;
64
60
}
65
61
66
- if ($ allow && !\in_array ($ name , $ allow , true )) {
62
+ // always allow default tag
63
+ if ($ default !== $ name && $ allow && !\in_array ($ name , $ allow , true )) {
67
64
continue ;
68
65
}
69
66
0 commit comments