-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unexpected spacing for anonymous classes with constructor arguments #3200
Comments
Looking at this: php-fig/fig-standards#1206 the consensus of the standard appears to be that the space should not be there, even if the current version of PSR-12 does not say anything regarding this topic. |
If the errata is accepted then I'd change the PSR-12 standard included with PHPCS. But right now the PSR-12 standard says:
And in the closures section, all the examples clearly show a space between the function keyword and the opening parenthesis of the argument list. So that's all I have to go on until a change is made to clarify things. |
For the record: PHP CS Fixer was changed to match PHP CodeSniffer: PHP-CS-Fixer/PHP-CS-Fixer#5924 |
Describe the bug
When creating an anonymous class while passing constructor arguments phpcs requests a space between
class
and the(
. I did not expect this and it looks off.Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above.phpcs test.php
Expected behavior
I expected that error not to be reported, because I believe there should not be a space between
class
and(
.Versions (please complete the following information):
Additional context
PHP-CS-Fixer with the PSR2 ruleset expects the space to not be there.
The text was updated successfully, but these errors were encountered: