PHP 클래스 Generic_Sniffs_Files_LineLengthSniff, PHP_CodeSniffer

Checks all lines in the file, and throws warnings if they are over 80 characters in length and errors if they are over 100. Both these figures can be changed by extending this sniff in your own standard.
저자: Greg Sherwood ([email protected])
저자: Marc McIntyre ([email protected])
상속: implements PHP_CodeSniffer_Sniff
파일 보기 프로젝트 열기: squizlabs/php_codesniffer 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$absoluteLineLimit integer Set to zero (0) to disable.
$lineLimit integer The limit that the length of a line should not exceed.

공개 메소드들

메소드 설명
process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : integer Processes this test, when one of its tokens is encountered.
register ( ) : array Returns an array of tokens this test wants to listen for.

보호된 메소드들

메소드 설명
checkLineLength ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $stackPtr ) : null | false Checks if a line is too long.

메소드 상세

checkLineLength() 보호된 메소드

Checks if a line is too long.
protected checkLineLength ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $stackPtr ) : null | false
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$tokens array The token stack.
$stackPtr integer The first token on the next line.
리턴 null | false

process() 공개 메소드

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

register() 공개 메소드

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

프로퍼티 상세

$absoluteLineLimit 공개적으로 프로퍼티

Set to zero (0) to disable.
public int $absoluteLineLimit
리턴 integer

$lineLimit 공개적으로 프로퍼티

The limit that the length of a line should not exceed.
public int $lineLimit
리턴 integer