From 97c3fd6c389ef5a48fa14c84c9b828200bf5e733 Mon Sep 17 00:00:00 2001 From: Joey Richard Date: Thu, 19 Jun 2025 15:57:43 -0300 Subject: [PATCH] Correcting an issue where there are two empty lines, first with an extra space, when there is no text to display on the first line. --- src/Barryvdh/Reflection/DocBlock/Serializer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Barryvdh/Reflection/DocBlock/Serializer.php b/src/Barryvdh/Reflection/DocBlock/Serializer.php index aabe06ac..46662b80 100644 --- a/src/Barryvdh/Reflection/DocBlock/Serializer.php +++ b/src/Barryvdh/Reflection/DocBlock/Serializer.php @@ -207,7 +207,7 @@ public function getDocComment(DocBlock $docblock) } $text = str_replace("\n", "\n{$indent} * ", $text); - $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n"; + $comment = !empty($text)? "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n" : "{$firstIndent}/**\n"; $tags = array_values($docblock->getTags());