Commit 4ce821e
committed
Squiz/DisallowMultipleAssignments: fix ignoring of property declarations
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 27871 parent 90b719d commit 4ce821e
File tree
2 files changed
+23
-8
lines changed- src/Standards/Squiz
- Sniffs/PHP
- Tests/PHP
2 files changed
+23
-8
lines changedLines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
67 | 77 | | |
68 | 78 | | |
69 | 79 | | |
| |||
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments