Commit 4d2d3d4
committed
Generic/ForbiddenFunctions: bug fix for class names in attributes
Attributes cannot contain function calls and in most cases, `T_STRING`s in an attribute will be a class name, not a function name.
As things were, `T_STRING`'s in attributes which _looked_ like function calls (but in actual fact are class instantiations) would lead to false positives.
Fixed now by ignoring all code within attributes.
Includes unit test.1 parent 693476f commit 4d2d3d4
File tree
3 files changed
+11
-1
lines changed- src/Standards
- Generic
- Sniffs/PHP
- Tests/PHP
- Squiz/Tests/PHP
3 files changed
+11
-1
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments