PHPCS
Control calidad de código.
Instalación en Debian 8
# curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
# php phpcs.phar -h
# curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
# php phpcbf.phar -h
Luego instalamos ...
# pear install PHP_CodeSniffer
Comprobamos ...
# phpcs --version
PHP_CodeSniffer version 3.0.2 (stable) by Squiz (http://www.squiz.net)
# phpcbf --version
PHP_CodeSniffer version 3.0.2 (stable) by Squiz (http://www.squiz.net)
Ejecutando un test...
# phpcs ./src/AppBundle/Controller/DefaultController.php
FILE: /var/www/html/marksteine/symfony/src/AppBundle/Controller/DefaultController.php
-----------------------------------------------------------------------------------------------
FOUND 63 ERRORS AND 3 WARNINGS AFFECTING 43 LINES
-----------------------------------------------------------------------------------------------
4 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
5 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
6 | ERROR | [x] Expected 3 space(s) before asterisk; 2 found
......
.....
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 48 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------
Time: 37ms; Memory: 4Mb