Commit 10c10ac
committed
Squiz/MethodScope: bugfix for unconventional spacing
The `Squiz.Scope.MethodScope` sniff is intended to check whether each method has visibility declared, but would in actual fact also enforce that the visibility should be on the same line as the `function` keyword as it stopped searching for the visibility keyword once it reached the start of the line.
Fixed now by using the `File::getMethodProperties()` method for determining visibility instead of searching with sniff specific logic.
Includes unit test.1 parent 2596a15 commit 10c10ac
File tree
2 files changed
+9
-11
lines changed- src/Standards/Squiz
- Sniffs/Scope
- Tests/Scope
2 files changed
+9
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 57 | + | |
| 58 | + | |
68 | 59 | | |
69 | 60 | | |
70 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments