Skip to content

Commit 7a921cd

Browse files
committed
Squiz/DisallowMultipleAssignments: fix sniff to work with the PHP 8 identifier tokens
The existing unit tests already contain tests covering this change.
1 parent 71c8de2 commit 7a921cd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,9 @@ public function process(File $phpcsFile, $stackPtr)
124124

125125
$start = $phpcsFile->findStartOfStatement($varToken);
126126

127-
$allowed = Tokens::$emptyTokens;
127+
$allowed = Tokens::$emptyTokens;
128+
$allowed += Tokens::$nameTokens;
128129

129-
$allowed[T_STRING] = T_STRING;
130-
$allowed[T_NS_SEPARATOR] = T_NS_SEPARATOR;
131130
$allowed[T_DOUBLE_COLON] = T_DOUBLE_COLON;
132131
$allowed[T_ASPERAND] = T_ASPERAND;
133132
$allowed[T_DOLLAR] = T_DOLLAR;

0 commit comments

Comments
 (0)