Installation instruction:
-
Install PHP CodeSniffer according to instruction found here:
-
Find PEAR directory:
pear config-show | grep php_dir
-
Checkout this two repos to folder
/path/to/pear/PHP/CodeSniffer/Standards
:git clone git://github.com/opensky/Symfony2-coding-standard.git Symfony2 git clone git://github.com/gellu/ZL-coding-standard ZL
-
Set ZL as default coding standard:
phpcs --config-set default_standard ZL
-
Set
tab
character for indent instead of spacesphpcs --config-set tab_width 4
-
Go to
PHPStorm -> Preferences
and use search with phrasecode sniffer
to findPHP Code Sniffer validation
. Set path to phpcs and chooseZL
standard as current. Apply. -
Done :)