Skip to content

Blink parity: close top laravel gaps, gate to 4% - #145

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-blink-parity-laravel-tune
Oct 5, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-blink-parity-laravel-tune

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Follow-up to #144. Three blink engine fixes that close the largest parity gaps against laravel/framework, plus lowering the laravel gate from 7.3% to 4%.

Fixes

1. SingleLineEmptyBody - collapse empty closure bodies
The fixer collapsed empty class and named-function bodies to {} but skipped anonymous functions, so function () {} stayed expanded over multiple lines. Now closures collapse too, matching php-cs-fixer.

2. ArraySyntax - skip a method named array
public function array(...) was rewritten to public function [...] (invalid PHP) because array( looked like the long-array construct. A function before the name is now skipped, same as the existing ->/:: guards.

3. NoEmptyPhpdoc - no doubled indent after removal
When an emptied docblock was removed, the following whitespace was de-newlined, leaving a dangling indent next to the preceding whitespace; the next line's indentation doubled (8 spaces instead of 4). When the preceding whitespace already carries the newline + indent, the trailing whitespace is now removed outright.

Parity impact (full prepared-set surface)

repo before after gate
laravel/framework 92.80% (7.20% diff) 96.06% (3.94% diff) 7.3% -> 4%
rectorphp/rector-src 1:1 (0 diff) 1:1 (0 diff) unchanged
mautic/mautic 0.088% diff 0.088% diff (same files) 0.15%

Verified locally: go test ./... and go vet pass; rector-src stays at 0 divergences and mautic at the same 4 files, so neither existing gate regresses.

Not included

Two further correctness bugs remain for follow-up PRs (they produce wrong output but are fewer files): NoLeadingImportSlash stripping the leading slash from a trait use, and NewWithParentheses turning new static::$prop into new static()::$prop.

…-removal indent; gate laravel to 4%

Three blink fixes that close the largest laravel/framework parity gaps:

- SingleLineEmptyBody now collapses empty closure bodies too, not just class
  and named-function bodies (function () {} stays single-line).
- ArraySyntax no longer rewrites a method named array() to [] - a name after
  function is skipped, like method/constant uses.
- NoEmptyPhpdoc removes an emptied docblock's trailing whitespace outright when
  the preceding whitespace already carries the newline and indent, instead of
  leaving a dangling indent that doubled the next line's indentation.

laravel/framework parity 92.80% -> 96.06% (diff 7.20% -> 3.94%); gate lowered
from 7.3% to 4%. rector-src 1:1 gate stays at 0 diffs and mautic stays at 0.088%.
@TomasVotruba
TomasVotruba merged commit 8591e67 into main Oct 5, 2026
10 of 19 checks passed
@TomasVotruba
TomasVotruba deleted the tv-blink-parity-laravel-tune branch October 5, 2026 21:02
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