Skip to content

Blink parity: YodaStyle + MAS dynamic-call reflow - #129

Merged
TomasVotruba merged 6 commits into
mainfrom
tv-blink-parity-under-08
Oct 4, 2026
Merged

TomasVotruba merged 6 commits into
mainfrom
tv-blink-parity-under-08

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Pushes blink parity on mautic/mautic further by porting the php-cs-fixer YodaStyle test suite and fixing the divergences it surfaced, plus a MethodArgumentSpace fix.

YodaStyle

  • Ported the php-cs-fixer YodaStyle test cases (421) as a Go table test.
  • Fixed the right comparison operand to stop at a ?> close tag - blink was pulling the tag into the operand and emitting invalid $$a?> == 1 under the non-yoda config mautic uses.
  • Excluded interpolated strings from constant detection, so "...{$x}..." is no longer treated as a yoda literal.
  • Treated concat . as higher precedence than comparison, so a concatenated operand is left alone.
  • Skipped comments between an operand and the operator when detecting boundaries.
  • Added an overlap guard so nested comparisons no longer interleave tokens.
  • Left a yoda-direction swap untouched when the primary carries a unary prefix (!!$a) instead of stranding the prefix.

The ported cases blink does not yet match (always_move_variable, the yoda direction on complex primaries, nested comparisons inside a subscript or dynamic member) are gated behind a documented known-failures allowlist; all remaining divergences are valid PHP. A listed case that starts passing fails the test so the list gets pruned.

MethodArgumentSpace

  • Reflow dynamic method call args ->{$op}(...) (previous token }).

Measured on mautic/mautic (app + plugins, all prepared sets): 68 of 4527 files differ (1.50%), under the 1.6% ratchet gate. No regression from the YodaStyle operand fixes.

Stop the right comparison operand at a ?> close tag so blink no longer
pulls it into the operand (was producing invalid $$a?> == 1 under the
non-yoda config). Leave a yoda-direction swap untouched when the primary
carries a unary prefix (!!$a) rather than stranding it.

Gate the ported php-cs-fixer YodaStyle cases behind a documented
known-failures allowlist so the WIP port stays green; a listed case that
starts passing fails the test so the list is pruned.
@TomasVotruba
TomasVotruba merged commit b1d842b into main Oct 4, 2026
18 checks passed
@TomasVotruba
TomasVotruba deleted the tv-blink-parity-under-08 branch October 4, 2026 05:54
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