Commit e4a1c05
Generic/UpperCaseConstantName: handle unconventional spacing and comments before
This commit fixes false positives in the sniff when handling
unconventional spacing and comments before `define`. When checking to
see if the `define` found is not a method call, the sniff would
incorrectly exclude only whitespaces. But comments can also be placed
between `define` and one of the tokens the sniff looks for
(T_OBJECT_OPERATOR, T_DOUBLE_COLON or T_NULLSAFE_OBJECT_OPERATOR).
Looking for the first non-empty token before `define` fixes this
problem.define
1 parent f26a0c2 commit e4a1c05
File tree
2 files changed
+6
-1
lines changed- src/Standards/Generic
- Sniffs/NamingConventions
- Tests/NamingConventions
2 files changed
+6
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments