PHP Class Squiz_Sniffs_Arrays_ArrayDeclarationSniff, PHP_CodeSniffer

Author: Greg Sherwood ([email protected])
Author: Marc McIntyre ([email protected])
Inheritance: implements PHP_CodeSniffer_Sniff
Show file Open project: squizlabs/php_codesniffer Class Usage Examples

Public Methods

Method Description
process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void Processes this sniff, when one of its tokens is encountered.
processMultiLineArray ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $arrayStart, integer $arrayEnd ) : void Processes a multi-line array definition.
processSingleLineArray ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $arrayStart, integer $arrayEnd ) : void Processes a single-line array definition.
register ( ) : array Returns an array of tokens this test wants to listen for.

Method Details

process() public method

Processes this sniff, when one of its tokens is encountered.
public process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void
$phpcsFile PHP_CodeSniffer_File The current file being checked.
$stackPtr integer The position of the current token in the stack passed in $tokens.
return void

processMultiLineArray() public method

Processes a multi-line array definition.
public processMultiLineArray ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $arrayStart, integer $arrayEnd ) : void
$phpcsFile PHP_CodeSniffer_File The current file being checked.
$stackPtr integer The position of the current token in the stack passed in $tokens.
$arrayStart integer The token that starts the array definition.
$arrayEnd integer The token that ends the array definition.
return void

processSingleLineArray() public method

Processes a single-line array definition.
public processSingleLineArray ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr, integer $arrayStart, integer $arrayEnd ) : void
$phpcsFile PHP_CodeSniffer_File The current file being checked.
$stackPtr integer The position of the current token in the stack passed in $tokens.
$arrayStart integer The token that starts the array definition.
$arrayEnd integer The token that ends the array definition.
return void

register() public method

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