PHP 클래스 Kohana_Sniffs_Operators_TernaryOperatorSniff, coding-standards

저자: Matthew Turland ([email protected])
저자: Chris Bandy ([email protected])
상속: implements PHP_CodeSniffer_Sniff
파일 보기 프로젝트 열기: kohana/coding-standards

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
_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

메소드 상세

_evaluate_portion() 보호된 메소드

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
리턴 void

_find_next() 보호된 메소드

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
리턴 integer | FALSE Index of the next token or FALSE

_find_next_invokation_or_access() 보호된 메소드

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
리턴 integer The position of the last token in the call (i.e. last non-whitespace token)

_find_previous() 보호된 메소드

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
리턴 integer | FALSE Index of the next token or FALSE

process() 공개 메소드

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
리턴 void

register() 공개 메소드

Returns an array of tokens this test wants to listen for.
public register ( ) : array
리턴 array