Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommend omitting wrapping parenthesis when immediately calling a method on a new instance #110

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

KorvinSzanto
Copy link
Contributor

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

@Crell
Copy link
Collaborator

Crell commented Jan 22, 2025

Looks good to me, but giving it a few days for the rest of the WG to approve/not.

@Crell Crell merged commit 5e2d262 into php-fig:master Mar 26, 2025
@@ -308,6 +308,23 @@ separated by a space. For example:
class MyException extends \RuntimeException {}
```

When accessing a class member immeditely after instantiating a new class, the instantiation SHOULD NOT be wrapped in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a small typo here, should be "immediately".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh. Since it's already merged, can you send a tiny PR? (I'm about to get on a plane.)

Copy link
Contributor

@devfrey devfrey Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! #112

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.

4 participants