Skip to content

UselessParentheses removes also usefull parentheses in dev-master (4.8.0) #478

@geerteltink

Description

@geerteltink

I just tested a fix in dev-master (4.8.0) and noticed a new bug in SlevomatCodingStandard.PHP.UselessParentheses.UselessParentheses.

Before:

        $response = (new Response())
            ->withStatus(200)
            ->withAddedHeader('Content-Type', 'text/plain');

After:

        $response = new Response()     // <--- Removed parentheses causes PHP Parse error:  
            ->withStatus(200)          // syntax error, unexpected '->' (T_OBJECT_OPERATOR)
            ->withAddedHeader('Content-Type', 'text/plain');

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