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

Incorrectly fixed list of class contants, separated by comma. #9

Closed
shirokovnv opened this issue Aug 5, 2022 · 1 comment
Closed

Comments

@shirokovnv
Copy link

shirokovnv commented Aug 5, 2022

Description

After upgrading from php version 7.4.16 to 8.1.7 and upgrading package version from 1.0 to 1.3, the fixer incorrectly indents
list of constants in classes.

Expected behaviour

Correct indentation of constants.

Actual behaviour

Indentation of constants starts incorrectly from the second line.

Steps to reproduce the behavior:

  • Define list of class constants with beautyful indentation.
class Myclass {
    public const
        IOS     = 'ios',
        ANDROID     = 'android',
        HUAWEI      = 'huawei';
...
  • Run fixer and see incorrect indentation:
class Myclass {
    public const
        IOS     = 'ios',
    ANDROID     = 'android', // ???
    HUAWEI      = 'huawei'; // ???

System information

  • PHP version(s): [8.1.7]
  • Package version(s): [1.3.0]
  • Version of pulled inner-dependency friendsofphp/php-cs-fixer is 3.9.5
@eldario
Copy link
Contributor

eldario commented May 15, 2023

@shirokovnv

Fixed with new rule single_class_element_per_statement in #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants