Skip to content

Printer: new empty line in docblock without trailing space - #337

Merged
ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
ondrejmirtes:printer-empty-text-no-trailing-space
Oct 28, 2026
Merged

ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
ondrejmirtes:printer-empty-text-no-trailing-space

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

printFormatPreserving() printed a new empty PhpDocTextNode as *, with a space at the end of the line. print() prints *.

Now the printer does not add the space after the asterisk when the new node prints as an empty string.

A new empty PhpDocTextNode was printed as " * ". print() prints " *".

Amp-Thread-ID: https://ampcode.com/threads/T-01a17930-0285-73c5-a957-4325c77aa1b2
@ondrejmirtes
ondrejmirtes force-pushed the printer-empty-text-no-trailing-space branch from eb586c7 to 21d6e6f Compare October 28, 2026 10:32
@ondrejmirtes
ondrejmirtes merged commit c9fb3e1 into phpstan:2.3.x Oct 28, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant