PHP 클래스 PHP_CodeSniffer_Tokens, PHP_CodeSniffer

The less the chance of a high occurrence of an arbitrary token, the higher the weighting.
저자: Greg Sherwood ([email protected])
저자: Marc McIntyre ([email protected])
파일 보기 프로젝트 열기: squizlabs/php_codesniffer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$arithmeticTokens array(int) Tokens that represent arithmetic operators.
$assignmentTokens array(int) Tokens that represent assignments.
$blockOpeners array(int) Tokens that open code blocks.
$booleanOperators array(int) Tokens that perform boolean operations.
$bracketTokens array(int) Tokens that represent brackets and parenthesis.
$castTokens array(int) Tokens that represent casting.
$commentTokens array(int) Tokens that are comments.
$comparisonTokens array(int) Tokens that represent comparison operator.
$emptyTokens array(int) Tokens that don't represent code.
$equalityTokens array(int) Tokens that represent equality comparisons.
$functionNameTokens array(int) Mostly, these are just strings. But PHP tokeizes some language constructs and functions using their own tokens.
$heredocTokens array(int) Tokens that make up a heredoc string.
$includeTokens array(int) Tokens that include files.
$knownLengths The token weightings.
$methodPrefixes array(int) Tokens that can prefix a method name
$operators array(int) Tokens that perform operations.
$parenthesisOpeners array(int) Token types that open parenthesis.
$scopeModifiers array(int) Tokens that represent scope modifiers.
$scopeOpeners array(int) Tokens that are allowed to open scopes.
$stringTokens array(int) Note that T_STRINGS are NOT represented in this list.
$weightings The token weightings.

공개 메소드들

메소드 설명
getHighestWeightedToken ( array $tokens ) : integer Returns the highest weighted token type.

비공개 메소드들

메소드 설명
__construct ( ) A PHP_CodeSniffer_Tokens class cannot be constructed.

메소드 상세

getHighestWeightedToken() 공개 정적인 메소드

Tokens are weighted by their approximate frequency of appearance in code - the less frequently they appear in the code, the higher the weighting. For example T_CLASS tokens appear very infrequently in a file, and therefore have a high weighting. Returns false if there are no weightings for any of the specified tokens.
public static getHighestWeightedToken ( array $tokens ) : integer
$tokens array
리턴 integer The highest weighted token.

프로퍼티 상세

$arithmeticTokens 공개적으로 정적으로 프로퍼티

Tokens that represent arithmetic operators.
public static array(int) $arithmeticTokens
리턴 array(int)

$assignmentTokens 공개적으로 정적으로 프로퍼티

Tokens that represent assignments.
public static array(int) $assignmentTokens
리턴 array(int)

$blockOpeners 공개적으로 정적으로 프로퍼티

Tokens that open code blocks.
public static array(int) $blockOpeners
리턴 array(int)

$booleanOperators 공개적으로 정적으로 프로퍼티

Tokens that perform boolean operations.
public static array(int) $booleanOperators
리턴 array(int)

$bracketTokens 공개적으로 정적으로 프로퍼티

Tokens that represent brackets and parenthesis.
public static array(int) $bracketTokens
리턴 array(int)

$castTokens 공개적으로 정적으로 프로퍼티

Tokens that represent casting.
public static array(int) $castTokens
리턴 array(int)

$commentTokens 공개적으로 정적으로 프로퍼티

Tokens that are comments.
public static array(int) $commentTokens
리턴 array(int)

$comparisonTokens 공개적으로 정적으로 프로퍼티

Tokens that represent comparison operator.
public static array(int) $comparisonTokens
리턴 array(int)

$emptyTokens 공개적으로 정적으로 프로퍼티

Tokens that don't represent code.
public static array(int) $emptyTokens
리턴 array(int)

$equalityTokens 공개적으로 정적으로 프로퍼티

Tokens that represent equality comparisons.
public static array(int) $equalityTokens
리턴 array(int)

$functionNameTokens 공개적으로 정적으로 프로퍼티

Mostly, these are just strings. But PHP tokeizes some language constructs and functions using their own tokens.
public static array(int) $functionNameTokens
리턴 array(int)

$heredocTokens 공개적으로 정적으로 프로퍼티

Tokens that make up a heredoc string.
public static array(int) $heredocTokens
리턴 array(int)

$includeTokens 공개적으로 정적으로 프로퍼티

Tokens that include files.
public static array(int) $includeTokens
리턴 array(int)

$knownLengths 공개적으로 정적으로 프로퍼티

The token weightings.
public static $knownLengths

$methodPrefixes 공개적으로 정적으로 프로퍼티

Tokens that can prefix a method name
public static array(int) $methodPrefixes
리턴 array(int)

$operators 공개적으로 정적으로 프로퍼티

Tokens that perform operations.
public static array(int) $operators
리턴 array(int)

$parenthesisOpeners 공개적으로 정적으로 프로퍼티

Token types that open parenthesis.
public static array(int) $parenthesisOpeners
리턴 array(int)

$scopeModifiers 공개적으로 정적으로 프로퍼티

Tokens that represent scope modifiers.
public static array(int) $scopeModifiers
리턴 array(int)

$scopeOpeners 공개적으로 정적으로 프로퍼티

Tokens that are allowed to open scopes.
public static array(int) $scopeOpeners
리턴 array(int)

$stringTokens 공개적으로 정적으로 프로퍼티

Note that T_STRINGS are NOT represented in this list.
public static array(int) $stringTokens
리턴 array(int)

$weightings 공개적으로 정적으로 프로퍼티

The token weightings.
public static $weightings