Squiz/DisallowMultipleAssignments: fix ignoring of property declarations#2788
Merged
gsherwood merged 1 commit intosquizlabs:masterfrom Mar 26, 2020
Conversation
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
|
Any ideas when we'll see this merged in/released? |
|
Bump. I could use this as well. |
Contributor
Author
|
@gsherwood Could this PR please be milestoned for |
|
I'm running into this one too. Would be great if this could make it into |
Member
|
Thanks for this fix. |
Contributor
Author
|
You're welcome ;-) |
|
Thanks @jrfnl! @gsherwood, do you have an eta for the release of |
Member
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Squiz.PHP.DisallowMultipleAssignmentsintended 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