Skip to content

Blink parity: break outer opener for call/new-wrapped nested arrays; gate to 0.3% - #138

Merged
TomasVotruba merged 2 commits into
mainfrom
tv-blink-parity-nest2
Oct 5, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
tv-blink-parity-nest2

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Extends the nested-array outer-opener break to call- and new-wrapped arrays. Measured drop: 15 to 12 differing files of 4527 (0.27%), 3 files fixed with zero regressions.

Note: stacked on #137 (collapse blank lines between call/parameter arguments). Review/merge #137 first; this rebases to a single commit after.

The pattern

Same outer-list-opener break as #135, but the enclosing list's element is itself an array or a call wrapping the associative array, so #135's "first element not an array" guard excluded it:

$this->report->method('getFilters')->willReturn([
    $this->createFilter([
        'value' => 1,
    ])]);

blink previously kept willReturn([$this->createFilter([ on the opener line. Same for new RequestStack([new Request([...])]).

The fix

enclosingListsForExpandedAssoc walks outward from the expanded associative array through call parens, new, and nested brackets, breaking the opener of every plain list whose last content (through that wrapper chain) is the assoc being expanded. Keeps both upstream guards per list (first element not itself an array; opener not already broken). Only the opener breaks (closer stays joined ])]);). Subsumes #135's direct case.

Gate

MAX_DIFF_PERCENT lowered 0.4 to 0.3; actual is 0.27% (12 of 4527).

Fixed: DynamicFiltersTypeTest, InjectCustomContentSubscriberTest, GrapesJsBuilderModelEditorStateTest. Unit tests cover call-wrapped, new-wrapped, and the first-element-is-array no-op. Full blink suite, go vet, golangci-lint green; strict rector-src 1:1 gate stays 0-diff.

…or new

Extends the nested-array opener break to an enclosing list whose last element
wraps the associative array in a call, "new" or further arrays
("[createFilter([assoc])]", "[new Request(..., [assoc])]"). Walk outward
through those wrappers, breaking the opener of every plain list whose last
content is the assoc being expanded, matching ECS.
@TomasVotruba
TomasVotruba force-pushed the tv-blink-parity-nest2 branch 2 times, most recently from 474c9d6 to c74db6f Compare October 5, 2026 09:53
@TomasVotruba
TomasVotruba merged commit e96c8a5 into main Oct 5, 2026
36 checks passed
@TomasVotruba
TomasVotruba deleted the tv-blink-parity-nest2 branch October 5, 2026 09:53
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