如何配置 PHP-CS-Fixer 以使用制表符进行缩进?
我可以看到 indentation_type
修复器
* indentation_type [@PSR2, @Symfony]
| Code MUST use configured indentation type.
但是如何配置缩进类型呢?如果我尝试设置 'indentation_type' => 'tab',
,我会收到错误
[indentation_type] Is not configurable.
最佳答案
它在文档中,但我是如何错过它的(可能是因为我正在搜索术语“制表符”而不是“缩进”)
对于寻找相同内容的其他人,PhpCsFixer\Config
中有一个setIndent
方法。
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'indentation_type' => true,
])
->setIndent("\t")
->setLineEnding("\n")
->setFinder($finder)
关于php - 在 PHP-CS-Fixer 中使用制表符缩进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42849484/