PHP 클래스 Generic_Sniffs_WhiteSpace_ScopeIndentSniff, PHP_CodeSniffer

Checks that control structures are structured correctly, and their content is indented correctly. This sniff will throw errors if tabs are used for indentation rather than spaces.
저자: Greg Sherwood ([email protected])
저자: Marc McIntyre ([email protected])
상속: implements PHP_CodeSniffer_Sniff
파일 보기 프로젝트 열기: squizlabs/php_codesniffer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$exact boolean If TRUE, indent needs to be exactly $indent spaces. If FALSE, indent needs to be at least $indent spaces (but can be more).
$ignoreIndentationTokens int[] Useful to allow Sniffs based on this to easily ignore/skip some tokens from verification. For example, inline HTML sections or PHP open/close tags can escape from here and have their own rules elsewhere.
$indent integer The number of spaces code should be indented.
$supportedTokenizers array A list of tokenizers this sniff supports.
$tabIndent boolean If TRUE, fixes will be made using tabs instead of spaces. The size of each tab is important, so it should be specified using the --tab-width CLI argument.

보호된 프로퍼티들

프로퍼티 타입 설명
$nonIndentingScopes int[] Any scope openers that should not cause an indent.

공개 메소드들

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

메소드 상세

process() 공개 메소드

Processes this test, when one of its tokens is encountered.
public process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void
$phpcsFile PHP_CodeSniffer_File All the tokens found in the document.
$stackPtr integer The position of the current token in the stack passed in $tokens.
리턴 void

register() 공개 메소드

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

프로퍼티 상세

$exact 공개적으로 프로퍼티

If TRUE, indent needs to be exactly $indent spaces. If FALSE, indent needs to be at least $indent spaces (but can be more).
public bool $exact
리턴 boolean

$ignoreIndentationTokens 공개적으로 프로퍼티

Useful to allow Sniffs based on this to easily ignore/skip some tokens from verification. For example, inline HTML sections or PHP open/close tags can escape from here and have their own rules elsewhere.
public int[] $ignoreIndentationTokens
리턴 int[]

$indent 공개적으로 프로퍼티

The number of spaces code should be indented.
public int $indent
리턴 integer

$nonIndentingScopes 보호되어 있는 프로퍼티

Any scope openers that should not cause an indent.
protected int[] $nonIndentingScopes
리턴 int[]

$supportedTokenizers 공개적으로 프로퍼티

A list of tokenizers this sniff supports.
public array $supportedTokenizers
리턴 array

$tabIndent 공개적으로 프로퍼티

If TRUE, fixes will be made using tabs instead of spaces. The size of each tab is important, so it should be specified using the --tab-width CLI argument.
public bool $tabIndent
리턴 boolean