ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

PHP_CodeSniffer缺少Zend标准?

2019-06-21 19:18:03  阅读:273  来源: 互联网

标签:php pear zend-framework codesniffer


我正在尝试使用PHP_CodeSniffer根据zend编码标准来嗅探php文件中的问题.
例如,问题是没有检测到一些基本规则

String Literals
$a = "Example String";
should give a warning because the standard is
$a = 'Example String';

我错过了什么,这不是代码标准的一部分吗?

解决方法:

根据respective pages in the ZF Reference Guide,它是Zend Coding Standard的一部分.但是,这并不一定意味着所有这些规则都包含在phpcs中.它们是不相关的项目.如果您查看ruleset defined for ZF in phpcs,您会在右上方看到此通知:

A coding standard based on an early Zend Framework coding standard. Note that this standard is out of date.

根据Wiki for ZF Coding Standards中的comment by Thomas Weidner判断,目前没有最新的PHPCS规则集可供使用:

My code sniffer implementation was not finished but it has also not been accepted by Zend. Several rules did not conform, were not checked, or were too strict. I had to delete it from Incubator. You can find the latest version by looking into SVN (

The CS files delivered with PHPCS do not conform any ZF standard.

I was said that Zend will not integrate a own CS testbed as it will use the new Pear2 standard as soon as it’s available. This is the reason why I did not do any additional work since last year.

So the actual state is that there is no official CS testbed available.

标签:php,pear,zend-framework,codesniffer
来源: https://codeday.me/bug/20190621/1256697.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有