From d103774cbe7e94ddee7e4870f97f727b43fe7201 Mon Sep 17 00:00:00 2001 From: Joey Richard Date: Thu, 17 Jul 2025 02:07:30 -0400 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. (#29) --- 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 aabe06a..46662b8 100644 --- a/src/Barryvdh/Reflection/DocBlock/Serializer.php +++ b/src/Barryvdh/Reflection/DocBlock/Serializer.php @@ -207,7 +207,7 @@ class Serializer } $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());