Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php-cs-fixer breaks indentation with else and <?php #4131

Closed
hannob opened this issue Dec 3, 2018 · 1 comment
Closed

php-cs-fixer breaks indentation with else and <?php #4131

hannob opened this issue Dec 3, 2018 · 1 comment

Comments

@hannob
Copy link
Contributor

hannob commented Dec 3, 2018

The PHP version you are using ($ php -v):

=> 7.2.12

PHP CS Fixer version you are using ($ php-cs-fixer -V):

=> 2.13.1

The command you use to run PHP CS Fixer:

=> php-cs-fixer fix [file]

The configuration file you are using, if any:

no configuration

If applicable, please provide minimum samples of PHP code (as plain text, not screenshots):

  • before running PHP CS Fixer (no changes):
<?php

$a==2;

if ($a==1) {
    ?>1
<?php
} else {
    echo "2";
}
  • with unexpected changes applied when running PHP CS Fixer:
<?php

$a==2;

if ($a==1) {
    ?>1
<?php
} else {
        echo "2";
    }
  • with the changes you expected instead:
    same as original

As you can see above php-cs-fixer breaks the indentation after the else-clause. It should have a 4 space indentation, but it's doing 8 spaces and it also shifts the closing bracket with 4 spaces.

@Wirone
Copy link
Member

Wirone commented Apr 2, 2023

I'm going to close this because issue mentions Fixer version which is not maintained anymore. Feel free to reproduce it on latest version (if problem still exists) and create new issue.

Also please have in mind that Fixer is focused on modern PHP, that does not mix code with HTML markup (see this comment), so there's high possibility that it won't be supported anyway.

@Wirone Wirone closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants