PHP Class 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.
Author: Greg Sherwood ([email protected])
Author: Marc McIntyre ([email protected])
Inheritance: implements PHP_CodeSniffer_Sniff
Afficher le fichier Open project: squizlabs/php_codesniffer Class Usage Examples

Méthodes publiques

Свойство Type Description
$absoluteLineLimit integer Set to zero (0) to disable.
$lineLimit integer The limit that the length of a line should not exceed.

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
checkLineLength ( PHP_CodeSniffer_File $phpcsFile, array $tokens, integer $stackPtr ) : null | false Checks if a line is too long.

Method Details

checkLineLength() protected méthode

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.
Résultat null | false

process() public méthode

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.
Résultat integer

register() public méthode

Returns an array of tokens this test wants to listen for.
public register ( ) : array
Résultat array

Property Details

$absoluteLineLimit public_oe property

Set to zero (0) to disable.
public int $absoluteLineLimit
Résultat integer

$lineLimit public_oe property

The limit that the length of a line should not exceed.
public int $lineLimit
Résultat integer