Skip to content
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

Squiz.Formatting.OperatorBracket duplicate error messages for unary minus #3258

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Mar 5, 2021

PHP 8.0 | Squiz/OperatorBracket: add tests with named function call parameters

... to confirm that the sniff does not break on these.

Squiz/OperatorBracket: bug fix - improve recognition of unary minus

The new test was giving three instead of two errors on line 194 for this snippet $padding * -1 + 3, with the errors being thrown on the *, - and the + operators.

The - operator, however, is a unary operator and should not trigger this error.

Fixed now.

…arameters

... to confirm that the sniff does not break on these.
The new test was giving _three_ instead of _two_ errors on line 194 for this snippet `$padding * -1 + 3`, with the errors being thrown on the `*`, `-` and the `+` operators.

The `-` operator, however, is a unary operator and should not trigger this error.

Fixed now.
@gsherwood gsherwood added this to the 3.6.0 milestone Mar 12, 2021
@gsherwood gsherwood changed the title Squiz/OperatorBracket: bug fix - improve recognition of unary minus + tests with named params Squiz.Formatting.OperatorBracket duplicate error messages for unary minus Mar 12, 2021
gsherwood added a commit that referenced this pull request Mar 12, 2021
@gsherwood gsherwood merged commit 5ffea57 into squizlabs:master Mar 12, 2021
@gsherwood
Copy link
Member

Thanks for fixing this bug, and for those additional test cases.

@jrfnl jrfnl deleted the feature/squiz-operatorbracket-bugfix-and-named-param-tests branch March 12, 2021 04:50
@jrfnl
Copy link
Contributor Author

jrfnl commented Mar 12, 2021

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants