标签:
安装:
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
参考文献:
http://nonfu.me/p/3886.html
标签:
原文地址:http://my.oschina.net/jiangbianwanghai/blog/474458