Skip to content

Generic.WhiteSpace.ScopeIndent can increase indent too much for lines within code blocks #1530

Closed
@michalbundyra

Description

@michalbundyra

File to fix:

<?php

class Test
{
    public function __construct()
    {
if (false) {
echo 0;
        }
    }
}

Fixing using only PEAR.WhiteSpace.ScopeIndent:

$ bin/phpcbf --sniffs=PEAR.WhiteSpace.ScopeIndent MyFile.php

Current result:

class Test
{
    public function __construct()
    {
        if (false) {
                echo 0;
        }
    }
}

Expecting result:

class Test
{
    public function __construct()
    {
        if (false) {
            echo 0;
        }
    }
}

Line inside if statement is indented too much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions