Skip to content

Commit fe8c504

Browse files
committed
Universal/NoDoubleNegative: use new Collections::ternaryOperators() token array
Ref: PHPCSStandards/PHPCSUtils 549
1 parent df7233e commit fe8c504

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHP_CodeSniffer\Sniffs\Sniff;
1515
use PHP_CodeSniffer\Util\Tokens;
1616
use PHPCSUtils\BackCompat\BCFile;
17+
use PHPCSUtils\Tokens\Collections;
1718
use PHPCSUtils\Utils\GetTokensAsString;
1819
use PHPCSUtils\Utils\Parentheses;
1920

@@ -50,12 +51,11 @@ final class NoDoubleNegativeSniff implements Sniff
5051
public function register()
5152
{
5253
// Collect all the operators only once.
53-
$this->operatorsWithLowerPrecedence = Tokens::$assignmentTokens;
54-
$this->operatorsWithLowerPrecedence += Tokens::$booleanOperators;
55-
$this->operatorsWithLowerPrecedence += Tokens::$comparisonTokens;
56-
$this->operatorsWithLowerPrecedence += Tokens::$operators;
57-
$this->operatorsWithLowerPrecedence[\T_INLINE_THEN] = \T_INLINE_THEN;
58-
$this->operatorsWithLowerPrecedence[\T_INLINE_ELSE] = \T_INLINE_ELSE;
54+
$this->operatorsWithLowerPrecedence = Tokens::$assignmentTokens;
55+
$this->operatorsWithLowerPrecedence += Tokens::$booleanOperators;
56+
$this->operatorsWithLowerPrecedence += Tokens::$comparisonTokens;
57+
$this->operatorsWithLowerPrecedence += Tokens::$operators;
58+
$this->operatorsWithLowerPrecedence += Collections::ternaryOperators();
5959

6060
return [\T_BOOLEAN_NOT];
6161
}

0 commit comments

Comments
 (0)