Commit d084f57
Fix duplicate star on continuation lines starting with * in tag descriptions
When a tag description contains continuation lines beginning with *, the *
was duplicated in the parsed output. This affected block-style @param
descriptions (e.g. WordPress-style docblocks with @type lines and star-
prefixed list items).
Root cause: tokenizeLine() split TOKEN_PHPDOC_EOL tokens with trailing
whitespace into a bare EOL + TOKEN_HORIZONTAL_WS pair, placing * in both
token values. When PHPStan rolled back past such a token on encountering a
tag-like token (@type), joinUntil() concatenated both raw values, doubling
the star.
Fix: prefix every continuation line with "* " before tokenizing. The lexer
always consumes the inserted "* " as part of TOKEN_PHPDOC_EOL, leaving
original indentation as a separate subsequent token. An unconditional
trim(..., "* \t") on every EOL token value strips the inserted "* " back
out. The manual split into TOKEN_HORIZONTAL_WS is no longer needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 9ce38cc commit d084f57
2 files changed
Lines changed: 46 additions & 14 deletions
File tree
- src/DocBlock/Tags/Factory
- tests/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
122 | 116 | | |
123 | 117 | | |
124 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
492 | 530 | | |
0 commit comments