Recommend omitting wrapping parenthesis when immediately calling a method on a new instance#110
Merged
Crell merged 2 commits intophp-fig:masterfrom Mar 26, 2025
Merged
Conversation
…thod on a new instance
Crell
approved these changes
Jan 22, 2025
Collaborator
|
Looks good to me, but giving it a few days for the rest of the WG to approve/not. |
samdark
approved these changes
Jan 22, 2025
devfrey
reviewed
Mar 27, 2025
| class MyException extends \RuntimeException {} | ||
| ``` | ||
|
|
||
| When accessing a class member immeditely after instantiating a new class, the instantiation SHOULD NOT be wrapped in |
Contributor
There was a problem hiding this comment.
There's a small typo here, should be "immediately".
Collaborator
There was a problem hiding this comment.
Sigh. Since it's already merged, can you send a tiny PR? (I'm about to get on a plane.)
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.
The wording for this was proving tricky so I've included a counter example to make it more obvious what we're recommending be omitted.
Relates to #89