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/DisallowMultipleAssignments: fix ignoring of property declarations #2788

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 31, 2019

The Squiz.PHP.DisallowMultipleAssignments intended to ignore property declarations, but did not allow for PHP 7.4 typed properties.

I've now moved the "is this a property ?" check up to bow out earlier for all properties.

Includes unit test.

I've also added tests for multi-property declarations. While it is debatable whether or not this sniff should report on these, the existing behaviour was to ignore them. This behaviour has been maintained and is now documented and safeguarded via the test.

Fixes #2787

The `Squiz.PHP.DisallowMultipleAssignments` intended to ignore property declarations, but did not allow for typed properties.

I've now moved the "is this a property ?" check up to bow out earlier for all properties.

Includes unit test.

I've also added tests for multi-property declarations. While it is debatable whether or not this sniff should report on these, the existing behaviour was to ignore them. This behaviour has been maintained and is now documented and safeguarded via the test.

Fixes 2787
@oojacoboo
Copy link

Any ideas when we'll see this merged in/released?

@Jeroeny
Copy link

Jeroeny commented Feb 25, 2020

Bump. I could use this as well.

@jrfnl
Copy link
Contributor Author

jrfnl commented Mar 10, 2020

@gsherwood Could this PR please be milestoned for 3.5.5 ? Seeing the responses so far I clearly wasn't the only one being plagued by this bug.

@BenHarris
Copy link

I'm running into this one too. Would be great if this could make it into 3.5.5!

@gsherwood gsherwood added this to the 3.5.5 milestone Mar 12, 2020
gsherwood added a commit that referenced this pull request Mar 26, 2020
@gsherwood gsherwood merged commit c5eaed8 into squizlabs:master Mar 26, 2020
@gsherwood
Copy link
Member

Thanks for this fix.

@jrfnl jrfnl deleted the feature/2787-squiz-disallowmultipleassignments-bugfix branch March 26, 2020 04:18
@jrfnl
Copy link
Contributor Author

jrfnl commented Mar 26, 2020

You're welcome ;-)

@BenHarris
Copy link

Thanks @jrfnl!

@gsherwood, do you have an eta for the release of 3.5.5?

@gsherwood
Copy link
Member

@gsherwood, do you have an eta for the release of 3.5.5?

I did, but then I had to begin working from home (along with the rest of the company) and now I'm swamped with work again. So I'm no longer sure.

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.

Squiz.PHP.DisallowMultipleAssignments not ignoring typed property declarations
5 participants