Use tab for indentation in PHP-CS-Fixer
First create .php_cs
file in your project root directory. Then add the below lines to .php_cs
file
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'indentation_type' => true,
])
->setIndent("\t")
->setLineEnding("\n")
->setFinder($finder)
Then run the below command to fix the issue
vendor/bin/php-cs-fixer fix . --config .php_cs
It was there in the documentation, and some how I missed it (probably because I was searching for the term 'tab' instead of 'indentation')
For anyone else looking for the same, there is a setIndent
method in PhpCsFixer\Config
.
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'indentation_type' => true,
])
->setIndent("\t")
->setLineEnding("\n")
->setFinder($finder)