PHP Class SlevomatCodingStandard\Sniffs\ControlStructures\YodaComparisonSniff

($variable, Foo::$class, Foo::bar(), foo()) > (Foo::BAR, BAR) > (true, false, null, 1, 1.0, arrays, 'foo')
Inheritance: implements PHP_CodeSniffer_Sniff
Exibir arquivo Open project: slevomat/coding-standard

Public Methods

Method Description
process ( PHP_CodeSniffer_File $phpcsFile, integer $comparisonTokenPointer )
register ( ) : integer[]

Private Methods

Method Description
getDynamismForTokens ( array $sideTokens ) : integer | null
getLeftSideTokens ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $comparisonTokenPointer ) : mixed[]
getRightSideTokens ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $comparisonTokenPointer ) : mixed[]
getStopTokenCodes ( ) : bool[]
getStopTokenCodes ( ) : integer[]
getTokenDynamism ( ) : integer[]
trimWhitespaceTokens ( array $tokens ) : mixed[]
write ( PHP_CodeSniffer_File $phpcsFile, array $leftSideTokens, array $rightSideTokens )

Method Details

process() public method

public process ( PHP_CodeSniffer_File $phpcsFile, integer $comparisonTokenPointer )
$phpcsFile PHP_CodeSniffer_File
$comparisonTokenPointer integer

register() public method

public register ( ) : integer[]
return integer[]