PHP 클래스 PHP_CodeSniffer_Tokenizers_PHP, PHP_CodeSniffer

파일 보기 프로젝트 열기: squizlabs/php_codesniffer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$endScopeTokens array This array is just a unique collection of the end tokens from the _scopeOpeners array. The data is duplicated here to save time during parsing of the file.
$scopeOpeners array This array also contains information about what kind of token the scope opener uses to open and close the scope, if the token strictly requires an opener, if the token can share a scope closer, and who it can be shared with. An example of a token that shares a scope closer is a CASE scope.
$skipMinified boolean If TRUE, files that appear to be minified will not be processed.

공개 메소드들

메소드 설명
processAdditional ( array &$tokens, string $eolChar ) : void Performs additional processing after main tokenizing.
resolveSimpleToken ( string $token ) : array Converts simple tokens into a format that conforms to complex tokens produced by token_get_all().
standardiseToken ( string | array $token ) : array Takes a token produced from token_get_all() and produces a more uniform token.
tokenizeString ( string $string, string $eolChar = '\n' ) : array Creates an array of tokens when given some PHP code.

메소드 상세

processAdditional() 공개 메소드

This additional processing checks for CASE statements that are using curly braces for scope openers and closers. It also turns some T_FUNCTION tokens into T_CLOSURE when they are not standard function definitions. It also detects short array syntax and converts those square brackets into new tokens. It also corrects some usage of the static and class keywords. It also assigns tokens to function return types.
public processAdditional ( array &$tokens, string $eolChar ) : void
$tokens array The array of tokens to process.
$eolChar string The EOL character to use for splitting strings.
리턴 void

resolveSimpleToken() 공개 정적인 메소드

Simple tokens are tokens that are not in array form when produced from token_get_all().
public static resolveSimpleToken ( string $token ) : array
$token string The simple token to convert.
리턴 array The new token in array format.

standardiseToken() 공개 정적인 메소드

Takes a token produced from token_get_all() and produces a more uniform token.
public static standardiseToken ( string | array $token ) : array
$token string | array The token to convert.
리턴 array The new token.

tokenizeString() 공개 메소드

Starts by using token_get_all() but does a lot of extra processing to insert information about the context of the token.
public tokenizeString ( string $string, string $eolChar = '\n' ) : array
$string string The string to tokenize.
$eolChar string The EOL character to use for splitting strings.
리턴 array

프로퍼티 상세

$endScopeTokens 공개적으로 프로퍼티

This array is just a unique collection of the end tokens from the _scopeOpeners array. The data is duplicated here to save time during parsing of the file.
public array $endScopeTokens
리턴 array

$scopeOpeners 공개적으로 프로퍼티

This array also contains information about what kind of token the scope opener uses to open and close the scope, if the token strictly requires an opener, if the token can share a scope closer, and who it can be shared with. An example of a token that shares a scope closer is a CASE scope.
public array $scopeOpeners
리턴 array

$skipMinified 공개적으로 프로퍼티

If TRUE, files that appear to be minified will not be processed.
public bool $skipMinified
리턴 boolean