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

minor: Make @PSR12 remove anonymous classes empty braces #6544

Conversation

julienfalque
Copy link
Member

Closes #6536.

IMO PSR-12 does not actually enforce or forbid empty braces for anonymous classes, but the examples imply it is preferred not to have them so always removing them is closer to that.

As a next step, I think it would be nice to make the anonymous_class option accept null, in which case it would ignore anonymous classes entirely.

@julienfalque julienfalque changed the title Make @PSR12 remove anonymous classes empty braces minor: Make @PSR12 remove anonymous classes empty braces Aug 8, 2022
@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.907% when pulling 663d064 on julienfalque:psr-12-anonymous-class-braces into 198293b on FriendsOfPHP:master.

@jrmajor
Copy link
Contributor

jrmajor commented Aug 8, 2022

Please see the discussions in #5892 and php-fig/fig-standards#1206 (review).

@julienfalque julienfalque deleted the psr-12-anonymous-class-braces branch August 10, 2022 17:12
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.

PSR-12: wrong fix when instanciating an anonymous class
3 participants