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

fix: Include the example of using the shortform of a closure #1283

Closed
wants to merge 2 commits into from

Conversation

fruitl00p
Copy link

This explains the use of "spaces" around fn ()

This explains the use of "spaces" around `fn ()`
@fruitl00p fruitl00p requested a review from a team as a code owner June 23, 2022 09:25
…entheses due to directly instantiating

This change aligns the required use of parentheses as mentioned in chapter `4. Classes, Properties, and Methods`:

> When instantiating a new class, parentheses MUST always be present even when
  there are no arguments passed to the constructor.
@Jean85
Copy link
Member

Jean85 commented Jun 23, 2022

I'm sorry, but we can't amend PSR-12 like this, it would have to go through an errata: https://www.php-fig.org/bylaws/psr-amendments/

At the same time, we're already working on https://github.com/php-fig/per-coding-style/, which is a natural successor of PSR-12. You should direct this suggestion there.

/cc @KorvinSzanto @Crell

@Jean85 Jean85 closed this Jun 23, 2022
fruitl00p added a commit to fruitl00p/per-coding-style that referenced this pull request Jun 23, 2022
… classes)

According to chapter 4:

> ## 4. Classes, Properties, and Methods
>
> The term "class" refers to all classes, interfaces, and traits.
>
> Any closing brace MUST NOT be followed by any comment or statement on the same line.
>
> When instantiating a new class, parentheses MUST always be present even when there are no arguments passed to the constructor.

This MR updates the spec to adhere to that rule on anonymous classes too.
(taken from moved from php-fig/fig-standards#1283 but also builds upon php-fig#17)
@Crell
Copy link
Contributor

Crell commented Jun 23, 2022

cf: php-fig/per-coding-style#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants