安装:
pear install PHP_CodeSniffer
查看安装
[root@vb002 ~]# /usr/local/php/bin/phpcs -i The installed coding standards are PSR1, Squiz, PHPCS, MySource, PEAR, Zend and PSR2 检查代码
[root@vb002 ~]# /usr/local/php/bin/phpcs /root/.jenkins/jobs/zentaotest/workspace/src/Money.php FILE: /root/.jenkins/jobs/zentaotest/workspace/src/Money.php ---------------------------------------------------------------------- FOUND 6 ERRORS AFFECTING 6 LINES ---------------------------------------------------------------------- 2 | ERROR | Missing file doc comment 3 | ERROR | Missing class doc comment 5 | ERROR | Private member variable "amount" must be prefixed with | | an underscore 7 | ERROR | Missing function doc comment 12 | ERROR | Missing function doc comment 17 | ERROR | Missing function doc comment ---------------------------------------------------------------------- Time: 29ms; Memory: 3Mb
卸载安装
[root@vb002 ~]# pear uninstall PHP_CodeSniffer-2.3.3 (责任编辑:IT) |