Blink parity: close top laravel gaps, gate to 4% - #145
Merged
Merged
Conversation
…-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%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, sofunction () {}stayed expanded over multiple lines. Now closures collapse too, matching php-cs-fixer.2. ArraySyntax - skip a method named
arraypublic function array(...)was rewritten topublic function [...](invalid PHP) becausearray(looked like the long-array construct. Afunctionbefore 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)
Verified locally:
go test ./...andgo vetpass; 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):
NoLeadingImportSlashstripping the leading slash from a traituse, andNewWithParenthesesturningnew static::$propintonew static()::$prop.