Skip to content

Commit 5629985

Browse files
jrfnlkukulich
authored andcommitted
Squiz/StaticThisUsage: improve enum tests
Let's also test that `$this` in a non-static enum method doesn't get flagged.
1 parent b0b4add commit 5629985

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ $b = new class()
117117
}
118118

119119
enum MyEnum {
120+
private function notStatic () {
121+
$this->doSomething();
122+
}
123+
120124
public static function myFunc() {
121125
$this->doSomething();
122126
}

src/Standards/Squiz/Tests/Scope/StaticThisUsageUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getErrorList()
3838
80 => 1,
3939
84 => 1,
4040
99 => 1,
41-
121 => 1,
41+
125 => 1,
4242
];
4343

4444
}//end getErrorList()

0 commit comments

Comments
 (0)