Skip to content

Comments are incorrectly reported by PSR2.ControlStructures.SwitchDeclaration sniff #683

@OndraM

Description

@OndraM

Hi,
since 2.3.3 (and caused probably by #621) comments are incorrectly reported as an error in following structure:

switch ($foo) {
    case 'bar': // some comment
        ...
        break;
    case 'baz': // other comment
        ...
        break;
    default: // other comment
        ...
        break;
}

On the lines with the comment following error occurs:
ERROR | [x] The CASE body must start on the line following the statement

... though the case body actually starts on a proper line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions