PHP Class Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff, PHP_CodeSniffer

Checks that arguments in function declarations are spaced correctly.
Author: Greg Sherwood ([email protected])
Author: Marc McIntyre ([email protected])
Inheritance: implements PHP_CodeSniffer_Sniff
Show file Open project: squizlabs/php_codesniffer

Public Properties

Property Type Description
$equalsSpacing integer How many spaces should surround the equals signs.
$requiredSpacesAfterOpen integer How many spaces should follow the opening bracket.
$requiredSpacesBeforeClose integer How many spaces should precede the closing bracket.

Public Methods

Method Description
process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : void Processes this test, when one of its tokens is encountered.
processBracket ( PHP_CodeSniffer_File $phpcsFile, integer $openBracket ) : void Processes the contents of a single set of brackets.
register ( ) : array Returns an array of tokens this test wants to listen for.

Method Details

process() public method

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

processBracket() public method

Processes the contents of a single set of brackets.
public processBracket ( PHP_CodeSniffer_File $phpcsFile, integer $openBracket ) : void
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$openBracket integer The position of the open bracket in the stack passed in $tokens.
return void

register() public method

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

Property Details

$equalsSpacing public property

How many spaces should surround the equals signs.
public int $equalsSpacing
return integer

$requiredSpacesAfterOpen public property

How many spaces should follow the opening bracket.
public int $requiredSpacesAfterOpen
return integer

$requiredSpacesBeforeClose public property

How many spaces should precede the closing bracket.
public int $requiredSpacesBeforeClose
return integer