File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Universal/Sniffs/CodeAnalysis Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 14
14
use PHP_CodeSniffer \Sniffs \Sniff ;
15
15
use PHP_CodeSniffer \Util \Tokens ;
16
16
use PHPCSUtils \BackCompat \BCFile ;
17
+ use PHPCSUtils \Tokens \Collections ;
17
18
use PHPCSUtils \Utils \GetTokensAsString ;
18
19
use PHPCSUtils \Utils \Parentheses ;
19
20
@@ -50,12 +51,11 @@ final class NoDoubleNegativeSniff implements Sniff
50
51
public function register ()
51
52
{
52
53
// 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 ();
59
59
60
60
return [\T_BOOLEAN_NOT ];
61
61
}
You can’t perform that action at this time.
0 commit comments