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

statement_indentation and arrays defined in a multiline const breaks indentation #8027

Open
2 tasks done
jackbentley opened this issue May 21, 2024 · 0 comments
Open
2 tasks done
Labels
kind/bug status/to verify issue needs to be confirmed or analysed to continue

Comments

@jackbentley
Copy link

Problem description

Similar to #7866

When defining multi line consts, and defining one of them as a multiline array with keys, the indentation of any following consts is incorrectly changed.

This seems to only happen when the array defines any keys and not when it only contains values.

Minimal reproducer

<?php

class Foo
{
    protected const
        READY = 'GO',
        FOO = [
            'Bar' => 'Foo'
        ],
        BAR = 'Foo',
        STOP = 'STOP';
}

Current changes:

@@ -7,6 +7,6 @@ class Foo
         FOO = [
             'Bar' => 'Foo'
         ],
-        BAR = 'Foo',
-        STOP = 'STOP';
+    BAR = 'Foo',
+    STOP = 'STOP';
 }

Expected changes:
None.

Fixer version

3.57.2

PHP version

8.3.6

How do you run Fixer?

Composer Shim package (binary only)

Contribution Checks

  • I have verified if this problem was already reported
  • I am familiar with "Feature or bug?"
@jackbentley jackbentley added kind/bug status/to verify issue needs to be confirmed or analysed to continue labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug status/to verify issue needs to be confirmed or analysed to continue
Projects
None yet
Development

No branches or pull requests

1 participant