Skip to content

Printer: keep the format of the tag value when the tag name changes - #340

Merged
ondrejmirtes merged 1 commit into
phpstan:2.4.xfrom
ondrejmirtes:doctrine-tag-rename
Oct 30, 2026
Merged

ondrejmirtes merged 1 commit into
phpstan:2.4.xfrom
ondrejmirtes:doctrine-tag-rename

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

When the name of a tag changes, the format-preserving printer printed the whole tag again. A multi-line Doctrine annotation became one line.

Now the printer replaces only the tag name token and keeps the tokens of the value.

The tokens of the top-level DoctrineAnnotation do not contain the annotation name. The tag prints the name, so a changed DoctrineAnnotation::$name is now ignored there. Before, the name was printed twice, e.g. @Bar@Bar(...).

@ondrejmirtes
ondrejmirtes merged commit af8e840 into phpstan:2.4.x Oct 30, 2026
65 of 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