简体   繁体   English

是否可以为不同的文件设置不同的 phpcs 配置值?

[英]Is it possible to have different phpcs configuration values for different files?

I'm using PHP_CodeSniffer with PHPCompatibility and I'd like to have different configuration values for different files.我将PHP_CodeSnifferPHPCompatibility一起使用,我想为不同的文件设置不同的配置值。

For some files I want the following configuration:对于某些文件,我需要以下配置:

<config name="testVersion" value="5.5-"/>

And for other files:对于其他文件:

<config name="testVersion" value="5.2-"/>

I'd like to do this from my phpcs.xml file.我想从我的phpcs.xml文件中执行此操作。 Is this possible?这可能吗?

This is apparently not possible.这显然是不可能的。 The best you can do is run phpcs twice with different rulesets or with different command-line arguments.最好的办法是使用不同的规则集或不同的命令行 arguments 运行phpcs两次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM