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

ClassAttributesSeparationFixer - ['property' => 'none'] Add unwanted blank line when comment present #7920

Open
Mushr0000m opened this issue Apr 4, 2024 · 0 comments
Labels
kind/bug topic/whitespace Indentation, spacing, new lines

Comments

@Mushr0000m
Copy link

Configuration

PHP 8.1.13
PHP CS Fixer 3.52.1 (5b7534c)
'class_attributes_separation' => [
    'elements' => [
        'const' => 'none',
        'method' => 'one',
        'property' => 'none',
        'trait_import' => 'none',
    ],
],

Description

I removed all fixers except this one, maybe I'm missing something but with the rule ['property' => 'none'] I expect to have zero blank line between all my properties. But it seems to fails if the property have a comment.

Actual result :

 class Foo
 {
    public $aa;
-
    public $bb;

    /**
     * Some comment
     */
    public $cc;

    // Some comment
    public $dd;
-
    public $ee;
 }

Expected result :

 class Foo
 {
    public $aa;
-
    public $bb;
-
    /**
     * Some comment
     */
    public $cc;
-
    // Some comment
    public $dd;
-
    public $ee;
 }
@Wirone Wirone added the topic/whitespace Indentation, spacing, new lines label Apr 4, 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