Skip to content

Comments in Control structures #51

@piotr-cz

Description

@piotr-cz

Sometimes putting a comment right inside the control structure is (IMHO) the best place:

// Perform tests
if ($foo
    // Testing phase 1
    && $foo->test1()
    // Testing phase 2
    && $foo->test2())
{
    echo 'True'
}

But code sniffer complains 😒

 35 | ERROR | Each line in a multi-line IF statement must begin with a boolean operator

What do you think about adjust the rule?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions