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.
Показать файл
Открыть проект
Примеры использования класса
Открытые свойства
Открытые методы
Метод |
Описание |
|
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()
защищенный Метод
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.
Описание свойств
$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 |
|