Skip to content

Commit 8a54aaa

Browse files
committed
PSR2.Classes.PropertyDeclaration: add T_STATIC to tokens list
In addition to scope modifiers, class properties currently have five modifier tokens: T_ABSTRACT, T_FINAL, T_READONLY, T_STATIC and T_VAR. The blame for this sniff does not explain why all but T_STATIC were added to the set of modifier tokens in the search list. T_VAR has been present since the file's creation and the other three were added one at a time as those modifiers were added. To that extent, perhaps T_STATIC was missed because the sniff itself uses getMemberProperties() and code to perform explicit checks on those properties? I'm not sure.
1 parent 44c338e commit 8a54aaa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ protected function processMemberVar(File $phpcsFile, int $stackPtr)
6060
$find = Tokens::SCOPE_MODIFIERS;
6161
$find[] = T_VARIABLE;
6262
$find[] = T_VAR;
63+
$find[] = T_STATIC;
6364
$find[] = T_READONLY;
6465
$find[] = T_FINAL;
6566
$find[] = T_ABSTRACT;

0 commit comments

Comments
 (0)