Add missing space in example for anonymous class declaration#90
Add missing space in example for anonymous class declaration#90Crell merged 1 commit intophp-fig:masterfrom
Conversation
|
Good catch, but I think the text should be fixed and not the example. |
Shouldn't the example be fixed for the current version of PER ? Only for the text (and example) to be changed/fixed in the next version of PER ? |
|
As a side-note: coding standards should be about consistency, "fixing" the text to make the spacing requirements for closures and anonymous classes different makes things _in_consistent. |
|
@jrfnl Off hand, do you know what CS and CSFixer do here? Do they follow the text or the example? |
I can't speak for CS-Fixer, but PHPCS follows the text of the PSR to the letter and only falls back to the examples when the text is unclear or states "as per the example ...". For this particular case, I just happen to know that both PHPCS as well as CS-Fixer enforce one space. See squizlabs/PHP_CodeSniffer#3200 for a previous discussion about this (and confirmation). |
|
Then let's go ahead and fix the example to match the text, since that's how everyone else is interpreting it. If we wanted to change that, it would be a separate discussion for a later release. I'll leave this open for a day or so in case someone else from the working group wants to weigh in, then merge it if no one makes a compelling argument. |
According to the specification:
Therefore a space must be between the class keyword and the opening parenthesis, as with closures.