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

multiline_whitespace_before_semicolons doesn't work with multiline const #7867

Open
jackbentley opened this issue Mar 5, 2024 · 0 comments
Labels
kind/bug topic/whitespace Indentation, spacing, new lines

Comments

@jackbentley
Copy link

Bug report

Description

multiline_whitespace_before_semicolons with new_line_for_chained_calls will incorrectly "fix" multiline consts.

Runtime version

$ bin/php-cs-fixer -V
PHP CS Fixer 3.51.0 (008b824) Insomnia by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 7.4.33

Used command

$ bin/php-cs-fixer check -vvv foo.php --diff

Configuration file

'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],

Code snippet that reproduces the problem

<?php

class Foo
{
    protected const
        FOO = 'Bar',
        BAR = 'Foo'
    ;
}

results in:

@@ -4,6 +4,5 @@
 {
     protected const
         FOO = 'Bar',
-        BAR = 'Foo'
-    ;
+        BAR = 'Foo';
 }
@Wirone Wirone added the topic/whitespace Indentation, spacing, new lines label Mar 11, 2024
@Wirone Wirone changed the title multiline_whitespace_before_semicolons doesn't work with multiline const multiline_whitespace_before_semicolons doesn't work with multiline const Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug topic/whitespace Indentation, spacing, new lines
Projects
None yet
Development

No branches or pull requests

2 participants