2017-03-17 29 views
3

如何配置PHP-CS-Fixer以使用製表符縮進?在PHP-CS-Fixer中使用製表符縮進

我可以看到indentation_type定影液

* indentation_type [@PSR2, @Symfony] 
    | Code MUST use configured indentation type. 

但我怎麼配置縮進式?如果我嘗試設置'indentation_type' => 'tab',,我收到錯誤

[indentation_type] Is not configurable. 

回答

6

是那裏的文檔中,以及一些如何我錯過了(可能是因爲我正在尋找一詞,而不是「縮進」「標籤」)

對於其他人正在尋找相同的,PhpCsFixer\Config有一個setIndent方法。

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