在php_codesniffer中,您可以忽略代码块的编码标准:
// @codingStandardsIgnoreStart
$a = ($b[$c >> 5 ] & 0x0080) &
($b[$c ] & 0x0100) & // here is a multi-line
// quote from some spec
($b[$c >> 20] );
// @codingStandardsIgnoreEnd
我认为这比更可读
$a = ($b[$c >> 5] & 0x0080) & ($b[$c] & 0x0100) & ($b[$c >> 20]);
php-cs-fixer是否允许您忽略像php_codesniffer这样的代码块的编码标准?
现在,PHP CS Fixer只允许您忽略给定的路径(您可以在配置文件中配置它(。不能忽略文件中的部分代码。如果你愿意,请毫不犹豫地提出一个实施了拟议功能的PR!