diff --git a/src/Barryvdh/Reflection/DocBlock/Serializer.php b/src/Barryvdh/Reflection/DocBlock/Serializer.php index 46662b8..87ebac4 100644 --- a/src/Barryvdh/Reflection/DocBlock/Serializer.php +++ b/src/Barryvdh/Reflection/DocBlock/Serializer.php @@ -206,6 +206,7 @@ class Serializer $text = wordwrap($text, $wrapLength); } $text = str_replace("\n", "\n{$indent} * ", $text); + $text = preg_replace('/^(\s*\*)[ \t]+$/m', '$1', $text); $comment = !empty($text)? "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n" : "{$firstIndent}/**\n"; @@ -220,6 +221,7 @@ class Serializer $tagText = wordwrap($tagText, $wrapLength); } $tagText = str_replace("\n", "\n{$indent} * ", $tagText); + $tagText = preg_replace('/^(\s*\*)[ \t]+$/m', '$1', $tagText); $comment .= "{$indent} * {$tagText}\n";