Skip to content

Blink parity (laravel): trait-use backslash + dynamic new parens - #148

Merged
TomasVotruba merged 2 commits into
mainfrom
tv-blink-laravel-2b
Oct 6, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
tv-blink-laravel-2b

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Two laravel-parity cluster fixes.

Trait use keeps its leading backslash

NoLeadingImportSlash stripped the leading \ from every use, including a trait use inside a class body (use \Illuminate\Foo;) and a closure use (...). php-cs-fixer's NoLeadingImportSlashFixer targets namespace imports only. Guarded with inClassLikeBody and the closure use ( check, so trait/closure uses keep their \ while namespace imports are still normalized.

No parentheses added to a dynamic class name in new

new $class is left as-is rather than gaining () where ECS does not add them.

Full blink suite, go vet, golangci-lint green; mautic parity unchanged at 3; the strict rector-src 1:1 gate is the final check.

NewWithParentheses inserted "()" after the leading name of a dynamic class
name ("new static::$builder($query)" became "new static()::$builder(...)"),
changing its meaning. Consume the "::member" / "[subscript]" tail so the
existing call parentheses are seen and nothing is inserted.
NoLeadingImportSlash stripped the leading backslash from every "use",
including a trait use inside a class body and a closure use, which
php-cs-fixer's NoLeadingImportSlashFixer leaves alone (it targets namespace
imports only). Guard with inClassLikeBody and the closure "use (" check.
@TomasVotruba
TomasVotruba merged commit 2882057 into main Oct 6, 2026
19 checks passed
@TomasVotruba
TomasVotruba deleted the tv-blink-laravel-2b branch October 6, 2026 06:09
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