When DocBlock text contains empty lines, str_replace replaces each newline
with a newline followed by ' * ', producing ' * ' (with trailing space) for
empty lines. This triggers trailing-whitespace linters.
Added a preg_replace after each str_replace call to strip trailing horizontal
whitespace from lines that consist only of ' *' followed by spaces.