';意外标记附近的语法错误';PHP code sniffer.xml文件中的错误,其中没有语法错误
';意外标记附近的语法错误';PHP code sniffer.xml文件中的错误,其中没有语法错误,php,phpcodesniffer,phpstorm-2017.1,Php,Phpcodesniffer,Phpstorm 2017.1,phpcs安装在系统上,代码嗅探可以从命令行正常工作 phpcs --extensions=php /path/to/code.php` ^很好 对于PHP Storm IDE,我在如下设置中指定了ruleset.xml文件的位置: Cmd+,PHP代码嗅探器验证编码标准自定义>ruleset.xml路径 但是,我得到了这个错误: PHP Code Sniffer phpcs: /Users/gketkar/code-sniffer/Blah/ruleset.xml: lin
phpcs
安装在系统上,代码嗅探可以从命令行正常工作
phpcs --extensions=php /path/to/code.php`
^很好
对于PHP Storm IDE,我在如下设置中指定了ruleset.xml文件的位置:
Cmd
+,
PHP代码嗅探器验证
编码标准
自定义
>ruleset.xml路径
但是,我得到了这个错误:
PHP Code Sniffer
phpcs: /Users/gketkar/code-sniffer/Blah/ruleset.xml: line 1: syntax error near unexpected token `newline'
/Users/gketkar/code-sniffer/Blah/ruleset.xml: line 1: `<?xml version="1.0"?>'
PHP代码嗅探器
phpcs:/Users/gketkar/code sniffer/Blah/ruleset.xml:第1行:意外标记“newline”附近的语法错误
/Users/gketkar/code sniffer/Blah/ruleset.xml:第1行:`'
更新:
ruleset.xml文件如下所示:
<?xml version="1.0"?>
<ruleset name="Blah">
<description>Blah Coding Standards</description>
<rule ref="Generic">
<exclude name="Generic.Formatting.SpaceAfterCast.NoSpace"/>
<exclude name="Generic.PHP.DeprecatedFunctions"/>
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/>
<exclude name="Generic.PHP.UpperCaseConstant.Found"/>
</rule>
</ruleset>
废话编码标准
这看起来像是将ruleset.xml
加载到了应具有phpcs
二进制文件的设置中。在PHPStorm中:
确保路径指向
phpcs
文件,而不是ruleset.xml
文件。如果没有,请尝试这看起来像是将ruleset.xml
加载到了应具有phpcs
二进制文件的设置中。在PHPStorm中:
确保路径指向
phpcs
文件,而不是ruleset.xml
文件。如果没有,请尝试xml文件的内容在哪里?xml文件的内容在哪里?