I've hit a problem with PHPCS using the PSR2 standard. Have searched high and low but to my surprise I can't find anyone reporting the same issue.
Say I have a class declaration as follows:
<?php
class MyChildClass extends \SomeNameSpace\MyParentClass
{
}
Then I run it through PHPCS with:
bash-3.2$ phpcs -s --standard=PSR2 test.php
FILE: test.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
3 | ERROR | Expected 0 spaces between "SomeNameSpace" and comma; $1 found
| | (PSR2.Classes.ClassDeclaration.SpaceBeforeComma)
3 | ERROR | Expected 1 space before "MyParentClass"; 13 found
| | (PSR2.Classes.ClassDeclaration.SpaceBeforeName)
--------------------------------------------------------------------------------
Time: 0 seconds, Memory: 4.00Mb
Also:
Bash-3.2$ phpcs --version
PHP_CodeSniffer version 1.3.6 (stable) by Squiz Pty Ltd. (http://www.squiz.net)
Has anyone come across this? Am I doing something wrong? Otherwise I'm going head first into the sniffer code - which doesn't feel right.