我们正在使用php补丁和PHPCodeSniffer工具作为我们的编码标准.当有不同的规则时,两者都会发生冲突。除了一条规则外,我们还能得到一个平衡的结果。PHP代码嗅探器引发的警告:
phpcs: Opening parenthesis of a multi-line function call must be the last content on the line
phpcs: Closing parenthesis of a multi-line function call must be on a line by itself这两个警告可能是由PEAR.Functions.FunctionCallSignature规则引起的。我们无法使用php-cs-补丁程序自定义配置自动修复此问题:
是所需结果的示例:
固定后:
$response = $this->client->post('users/authenticate', [
'form_params' => [
'email' => $email,
'password' => $password,
],
]);预期产出:
$response = $this->client->post(
'users/authenticate',
[
'form_params' => [
'email' => $email,
'password' => $password,
],
]
);是否有办法实现先前的输出?
发布于 2019-11-26 17:57:57
我用适当的工具解决了这个问题。我们使用phpcb实现了phpcb不像phpcb那样工作。正如在Github页面中提到的那样:
"PHP_CodeSniffer是由两个PHP脚本组成的一组;主phpcs脚本标记PHP、JavaScript和CSS文件以检测违反定义的编码标准,第二个phpcbf脚本用于自动纠正编码标准违规。PHP_CodeSniffer是确保代码保持干净和一致的重要开发工具。“
https://github.com/squizlabs/PHP_CodeSniffer
我们用了phpcb,现在一切都很好。
https://stackoverflow.com/questions/59055743
复制相似问题