-
-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
Description
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
<?php
$foo = new class() {};
// ^^
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.
- I have read the Contribution Guidelines and this is not a support question.
- I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
- I have verified the issue still exists in the
master
branch of PHP_CodeSniffer.