PHP-CS-Fixer: wrong indentation after comment in if statement
All leading whitespaces are tabs. Fixer is run with psr2 level. As a result echo ‘1’; is not indented properly. If I run fixer with config (listed below) then tab in echo line is not converted and line is not properly indented.
Also fixer doesn’t cut to minimum indentation level although I’m not sure if this is a bug or intended behaviour.
.php_cs
<?php
return Symfony\CS\Config\Config::create()
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::NONE_LEVEL)
->fixers(array(
'encoding',
'short_tag',
'braces',
'eof_ending',
'linefeed',
'parenthesis',
'php_closing_tag',
'whitespacy_lines',
'trailing_spaces',
'indentation'
))
;
test.php
<?php
if (false) {
// line after comment is not indented properly
echo '1';
$id = 10;
}
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
It works with small files but it does not work with longer files I tested (statements are still not indented after line comments). I will investigate this problem further.
Unit tests passed with these changes
OK, but incomplete, skipped, or risky tests! Tests: 5412, Assertions: 111016, Skipped: 34.