Repository navigation
Blink parity (laravel): trait-use backslash + dynamic new parens - #148
Merged
Merged
Conversation
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.
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.
Two laravel-parity cluster fixes.
Trait use keeps its leading backslash
NoLeadingImportSlashstripped the leading\from everyuse, including a trait use inside a class body (use \Illuminate\Foo;) and a closureuse (...). php-cs-fixer'sNoLeadingImportSlashFixertargets namespace imports only. Guarded withinClassLikeBodyand the closureuse (check, so trait/closure uses keep their\while namespace imports are still normalized.No parentheses added to a dynamic class name in new
new $classis 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.