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.PHP.DisallowMultipleAssignments not ignoring typed property declarations #2787

Closed
oojacoboo opened this issue Dec 30, 2019 · 2 comments · Fixed by #2788
Closed

Squiz.PHP.DisallowMultipleAssignments not ignoring typed property declarations #2787

oojacoboo opened this issue Dec 30, 2019 · 2 comments · Fixed by #2788
Milestone

Comments

@oojacoboo
Copy link

I'm getting an error on the following 7.4 compatible code:

protected ?int $id = null;
@jrfnl
Copy link
Contributor

jrfnl commented Dec 31, 2019

Confirmed. PR #2788 should fix this.

@bkdotcom
Copy link
Contributor

bkdotcom commented Jan 30, 2020

is this also a false positive?

} elseif (($position = \array_search($val, $array, true)) !== false) {

unrelated: the message this sniff throws doesn't really jive with the sniff name

Sniff name : DisallowMultipleAssignments
Error Message : "Assignments must be the first block of code on a line"

@gsherwood gsherwood added this to the 3.5.5 milestone Mar 12, 2020
@gsherwood gsherwood changed the title Squiz.PHP.DisallowMultipleAssignments.Found Squiz.PHP.DisallowMultipleAssignments not ignoring typed property declarations Mar 26, 2020
gsherwood added a commit that referenced this issue Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants