File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -4253,22 +4253,15 @@ public static function extractExposedComment(array $comments): ?ExposedDocCommen
42534253function parseDocComments(array $comments): array {
42544254 $tags = [];
42554255 foreach ($comments as $comment) {
4256- if ($comment instanceof DocComment) {
4257- $tags = array_merge($tags, parseDocComment($comment)) ;
4256+ if (!( $comment instanceof DocComment) ) {
4257+ continue ;
42584258 }
4259- }
4260-
4261- return $tags;
4262- }
4263-
4264- /** @return DocCommentTag[] */
4265- function parseDocComment(DocComment $comment): array {
4266- $commentText = substr($comment->getText(), 2, -2);
4267- $tags = [];
4268- foreach (explode("\n", $commentText) as $commentLine) {
4269- $regex = '/^\*\s*@([a-z-]+)(?:\s+(.+))?$/';
4270- if (preg_match($regex, trim($commentLine), $matches)) {
4271- $tags[] = new DocCommentTag($matches[1], $matches[2] ?? null);
4259+ $commentText = substr($comment->getText(), 2, -2);
4260+ foreach (explode("\n", $commentText) as $commentLine) {
4261+ $regex = '/^\*\s*@([a-z-]+)(?:\s+(.+))?$/';
4262+ if (preg_match($regex, trim($commentLine), $matches)) {
4263+ $tags[] = new DocCommentTag($matches[1], $matches[2] ?? null);
4264+ }
42724265 }
42734266 }
42744267
You can’t perform that action at this time.
0 commit comments