Skip to content

Invalid Doctrine tag with backslash: return InvalidTagValueNode - #335

Merged
ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
ondrejmirtes:doctrine-tag-invalid-value
Oct 28, 2026
Merged

ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
ondrejmirtes:doctrine-tag-invalid-value

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

parse() threw ParserException for an invalid Doctrine tag that starts with a backslash, for example @\ORM\Table('user'). The tags after it were lost.

Now this tag gets InvalidTagValueNode, the same as other tags in parseTagValue(), and the parser continues with the next tags.

parse() threw ParserException for an invalid @\Foo(...) tag.
Other tags already get InvalidTagValueNode in parseTagValue().

Amp-Thread-ID: https://ampcode.com/threads/T-01a17930-0285-73c5-a957-4325c77aa1b2
@ondrejmirtes
ondrejmirtes force-pushed the doctrine-tag-invalid-value branch from 83695f4 to 4f38283 Compare October 28, 2026 09:31
@ondrejmirtes
ondrejmirtes merged commit a53805e into phpstan:2.3.x Oct 28, 2026
66 of 68 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