I ran into a problem with PHPCS using the PSR2 standard. Searched high and low, but to my surprise, I can not find anyone reporting the same problem.
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:
Has anyone come across this? Am I doing something wrong? Otherwise, I will go first to the sniffer code, which does not feel good.
source
share