Skip to content

Commit 1cdc2c2

Browse files
committed
Modernize: Generic/UselessOverridingMethod: use class constant for constant array
1 parent 48cff2b commit 1cdc2c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class UselessOverridingMethodSniff implements Sniff
3333
*
3434
* @var array<int|string, bool> Keys are the token constants, value is irrelevant.
3535
*/
36-
private $validOOScopes = [
36+
private const VALID_OO_SCOPES = [
3737
T_CLASS => true,
3838
T_ANON_CLASS => true,
3939
T_TRAIT => true,
@@ -74,8 +74,8 @@ public function process(File $phpcsFile, $stackPtr)
7474
$conditions = $token['conditions'];
7575
$lastCondition = end($conditions);
7676

77-
// Skip functions that are not a method part of a class, anon class or trait.
78-
if (isset($this->validOOScopes[$lastCondition]) === false) {
77+
// Skip functions that are not a method, i.e. part of a class, anon class or trait.
78+
if (isset(self::VALID_OO_SCOPES[$lastCondition]) === false) {
7979
return;
8080
}
8181

0 commit comments

Comments
 (0)