当前位置: > CentOS > CentOS教程 >

Centos6.6安装PHP_CodeSniffer

时间:2016-12-08 18:45来源:linux.it.net.cn 作者:IT

安装:

 

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)
------分隔线----------------------------
栏目列表
推荐内容