Skip to content

Commit 7f874e3

Browse files
rodrigoprimojrfnl
andcommitted
Rename UselessOverridingMethodSniff property and improve its docblock
Co-authored-by: Juliette <[email protected]>
1 parent 6d1eb17 commit 7f874e3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ class UselessOverridingMethodSniff implements Sniff
2929
{
3030

3131
/**
32-
* List of class and trait tokens. Used to detect functions that
33-
* are part of a class, anon class or trait.
32+
* Object-Oriented scopes in which a call to parent::method() can exist.
3433
*
35-
* @var array
34+
* @var array<int|string, bool> Keys are the token constants, value is irrelevant.
3635
*/
37-
private $classAndTraitTokens = [
36+
private $validOOScopes = [
3837
T_CLASS => true,
3938
T_ANON_CLASS => true,
4039
T_TRAIT => true,
@@ -76,7 +75,7 @@ public function process(File $phpcsFile, $stackPtr)
7675
$lastCondition = end($conditions);
7776

7877
// Skip functions that are not a method part of a class, anon class or trait.
79-
if (isset($this->classAndTraitTokens[$lastCondition]) === false) {
78+
if (isset($this->validOOScopes[$lastCondition]) === false) {
8079
return;
8180
}
8281

0 commit comments

Comments
 (0)