Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
geerteltink opened this issue Sep 14, 2018 · 3 comments
Closed
Labels
Milestone

Comments

@geerteltink
Copy link

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');
@kukulich
Copy link
Contributor

Thank you for your report.

Fixed in 0ca9277

@kukulich kukulich added the Bug label Sep 14, 2018
@kukulich kukulich added this to the 4.8.0 milestone Sep 14, 2018
@geerteltink
Copy link
Author

Wow... you are fast :)

Confirmed that it's fixed. Thanx.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants