HumHub Documentation (unofficial)

ComparisonOperatorUsageSniff
in package
implements Sniff

Table of Contents

Interfaces

Sniff

Properties

$supportedTokenizers  : array<string|int, mixed>
A list of tokenizers this sniff supports.
$invalidOps  : array<string, array<int, string>>
A list of invalid operators with their alternatives.
$validOps  : array<string|int, mixed>
A list of valid comparison operators.

Methods

process()  : void
Process the tokens that this sniff is listening for.
register()  : array<string|int, int|string>
Registers the token types that this sniff wishes to listen to.

Properties

$supportedTokenizers

A list of tokenizers this sniff supports.

public array<string|int, mixed> $supportedTokenizers = ['PHP', 'JS']

$invalidOps

A list of invalid operators with their alternatives.

private static array<string, array<int, string>> $invalidOps = ['PHP' => [T_IS_EQUAL => '===', T_IS_NOT_EQUAL => '!==', T_BOOLEAN_NOT => '=== FALSE'], 'JS' => [T_IS_EQUAL => '===', T_IS_NOT_EQUAL => '!==']]

$validOps

A list of valid comparison operators.

private static array<string|int, mixed> $validOps = [T_IS_IDENTICAL => true, T_IS_NOT_IDENTICAL => true, T_LESS_THAN => true, T_GREATER_THAN => true, T_IS_GREATER_OR_EQUAL => true, T_IS_SMALLER_OR_EQUAL => true, T_INSTANCEOF => true]

Methods

process()

Process the tokens that this sniff is listening for.

public process(File $phpcsFile, int $stackPtr) : void
Parameters
$phpcsFile : File

The file where the token was found.

$stackPtr : int

The position in the stack where the token was found.

register()

Registers the token types that this sniff wishes to listen to.

public register() : array<string|int, int|string>
Return values
array<string|int, int|string>

        
On this page

Search results