Files that were not fixed due to errors reported during linting before fixing:
[PhpCsFixer\Linter\LintingException]
PHP Parse error: syntax error, unexpected ':' on line 10.
$ php -v):PHP 7.3.9 (cli) (built: Nov 9 2019 08:08:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.9, Copyright (c) 1998-2018 Zend Technologies
$ php-cs-fixer -V):PHP CS Fixer 2.16.1 Yellow Bird by Fabien Potencier and Dariusz Ruminski (c8afb59)
php-cs-fixer fix -vvv --rules=indentation_type test-nested-if-endif.php
<?php
$test = true;
$another = false;
if ($test):
if ($another) {
echo 'test another';
}
else:
if ($another) {
echo 'another';
}
endif;
[PhpCsFixer\Linter\LintingException]
PHP Parse error: syntax error, unexpected ':' on line 10.
<?php
$test = true;
$another = false;
if ($test):
if ($another) {
echo 'test another';
}
else:
if ($another) {
echo 'another';
}
endif;
Hi and thanks for your report,
Both the before code and expected code is not valid PHP, that is why it cannot be fixed by the tool. This is a limitation by design,
@SpacePossum thank you for spotting that