Skip to content

Indention false positive in switch/case/if combination #2414

Closed
@aimeos

Description

@aimeos

The "Generic.Whitespace.ScopeIndent" sniff reports a false indention for switch/case statements that contains an if-condition, e.g.:

    switch($type)
    {
        case 'a':
            if($operator == '~=') {
                $value = true;
                break;
            }
        default:
            $value = false;
    }

Result for line with default and below:

 8 | ERROR | [x] Line indented incorrectly; expected 12 spaces, found 8
 9 | ERROR | [x] Line indented incorrectly; expected at least 16 spaces, found 12

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