You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while developing tests for PER2.0, I got the error: PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword, but when diving into specifications for PSR-12, I could not found anything related to spacing being required there.
Code sample
<?php$foo = newclass() {};
// ^^
Here an error is raised about needing a space between the arguments for the class and the first opening-parenthesis. But nowhere in the specification, nor the errata, I can find on required spacing after class keywords.
What it should be is a bit ambiguous, but when it is not specified it should not be checked. It is 'class instantiation' and should require parentheses. But the space there should not be checked imo.
Custom ruleset
N/A
Expected behavior
I think we need to mute this error.
Please confirm
I have searched the issue list and am not opening a duplicate issue.
Describe the bug
Found while developing tests for PER2.0, I got the error:
PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword
, but when diving into specifications for PSR-12, I could not found anything related to spacing being required there.Code sample
Here an error is raised about needing a space between the arguments for the class and the first opening-parenthesis. But nowhere in the specification, nor the errata, I can find on required spacing after class keywords.
What it should be is a bit ambiguous, but when it is not specified it should not be checked. It is 'class instantiation' and should require parentheses. But the space there should not be checked imo.
Custom ruleset
N/A
Expected behavior
I think we need to mute this error.
Please confirm
master
branch of PHP_CodeSniffer.The text was updated successfully, but these errors were encountered: