在PHP CS Fixer中使用缩进选项卡

在PHP CS Fixer中使用缩进选项卡,php,php-cs-fixer,Php,Php Cs Fixer,如何配置PHP CS修复程序以使用制表符进行缩进 我可以看到indentation\u typefixer * indentation_type [@PSR2, @Symfony] | Code MUST use configured indentation type. 但是如何配置缩进类型呢?如果我试图设置'indentation\u type'=>'tab',,我会得到错误 [indentation_type] Is not configurable. 它就在文档中,我怎么会错过它(

如何配置PHP CS修复程序以使用制表符进行缩进

我可以看到
indentation\u type
fixer

* indentation_type [@PSR2, @Symfony]
  | Code MUST use configured indentation type.
但是如何配置缩进类型呢?如果我试图设置
'indentation\u type'=>'tab',
,我会得到错误

[indentation_type] Is not configurable.

它就在文档中,我怎么会错过它(可能是因为我在搜索术语“tab”而不是“indentation”)

对于其他正在寻找相同的方法的人,在
PhpCsFixer\Config
中有一个
setIndent
方法

return PhpCsFixer\Config::create()
    ->setRules([
        '@PSR2' => true,
        'indentation_type' => true,
    ])
    ->setIndent("\t")
    ->setLineEnding("\n")
    ->setFinder($finder)

首先在项目根目录中创建
.php\u cs
文件。然后将以下行添加到
.php\u cs
文件中

<?php
return PhpCsFixer\Config::create()
->setRules([
    '@PSR2' => true,
    'indentation_type' => true,
])
->setIndent("\t")
->setLineEnding("\n")
->setFinder($finder)

在所有规则上都有这些数组和没有好的文档,这真的很烦人。。。像-> UETABSFordRunTune()这样的方法将更加具有描述性和易于发现的思想,提供了一个自动完成。即使有一个方法是好的,我认为它只是一个小的不便。由于这是一个项目的一次性配置,而且在所有项目中几乎都是一样的,因此我不认为IDE自动完成是一个巨大的优势。问题是关于使用
选项卡
进行缩进,您的回答解释了如何使用
空格
@joycebab谢谢您的评论,我已经更新了tab的代码。现在这是现有答案的副本。附加值是什么?如果我们必须解决问题,我们需要代码和命令来解决问题。
vendor/bin/php-cs-fixer fix . --config .php_cs