PHP Class Kohana_Sniffs_Operators_TernaryOperatorSniff, coding-standards

Author: Matthew Turland ([email protected])
Author: Chris Bandy ([email protected])
Inheritance: implements PHP_CodeSniffer_Sniff
Afficher le fichier Open project: kohana/coding-standards

Méthodes publiques

Méthode Description
process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void Processes this test, when one of its tokens is encountered.
register ( ) : array Returns an array of tokens this test wants to listen for.

Méthodes protégées

Méthode Description
_evaluate_portion ( PHP_CodeSniffer_File $file, string $name, integer $start, integer $end ) : void Verifies one operand of a ternary operation follows Kohana coding standards
_find_next ( array | integer $type, array $tokens, integer $start, integer $end, integer $parenthesis ) : integer | FALSE Find the index of the next token of a certain type in a particular parentheses group
_find_next_invokation_or_access ( $current, $next, $tokens, $end, $name, PHP_CodeSniffer_File $file ) : integer Find the next invokation or access of an object's or static class' members.
_find_previous ( array | integer $type, array $tokens, integer $start, integer $end, integer $parenthesis ) : integer | FALSE Find the index of the previous token of a certain type in a particular parentheses group

Method Details

_evaluate_portion() protected méthode

Verifies one operand of a ternary operation follows Kohana coding standards
protected _evaluate_portion ( PHP_CodeSniffer_File $file, string $name, integer $start, integer $end ) : void
$file PHP_CodeSniffer_File
$name string Portion being evaluated. Used in error messages.
$start integer Index of the first token in the portion
$end integer Index of the last token in the portion
Résultat void

_find_next() protected méthode

Find the index of the next token of a certain type in a particular parentheses group
protected _find_next ( array | integer $type, array $tokens, integer $start, integer $end, integer $parenthesis ) : integer | FALSE
$type array | integer Token type(s) to find
$tokens array Tokens to search
$start integer Index from which to begin
$end integer Index at which to abort
$parenthesis integer Index of the closing parenthesis or NULL
Résultat integer | FALSE Index of the next token or FALSE

_find_next_invokation_or_access() protected méthode

Find the next invokation or access of an object's or static class' members.
protected _find_next_invokation_or_access ( $current, $next, $tokens, $end, $name, PHP_CodeSniffer_File $file ) : integer
$file PHP_CodeSniffer_File
Résultat integer The position of the last token in the call (i.e. last non-whitespace token)

_find_previous() protected méthode

Find the index of the previous token of a certain type in a particular parentheses group
protected _find_previous ( array | integer $type, array $tokens, integer $start, integer $end, integer $parenthesis ) : integer | FALSE
$type array | integer Token type(s) to find
$tokens array Tokens to search
$start integer Index from which to begin
$end integer Index at which to abort
$parenthesis integer Index of the opening parenthesis or NULL
Résultat integer | FALSE Index of the next token or FALSE

process() public méthode

Processes this test, when one of its tokens is encountered.
public process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void
$phpcsFile PHP_CodeSniffer_File
$stackPtr integer Position of the current token in the stack
Résultat void

register() public méthode

Returns an array of tokens this test wants to listen for.
public register ( ) : array
Résultat array