yiisoft/yii2-coding-standards

Undefined offset: 3 with PHP CodeSniffer 1.5.2

ErikMinekus opened this issue · 1 comments

When running phpcs 1.5.2 with the Yii2 standard, the following error occurs:

PHP Notice: Undefined offset: 3 in CodeSniffer.php on line 1050

This is because even though the PrivatePropertiesUnderscoreSniff.php file is not listed in the ruleset, it's still being loaded. However it should be in a subfolder, for example Yii2/Sniffs/Classes. Then the class should be renamed to Yii2_Sniffs_Classes_PrivatePropertiesUnderscoreSniff.

Thanks for your work!