MultipleStatementAlignmentSniff
in package
implements
Sniff
Interfaces, Classes and Traits
Table of Contents
- $alignAtEnd : bool
- Controls which side of the assignment token is used for alignment.
- $error : bool
- If true, an error will be thrown; otherwise a warning.
- $maxPadding : int
- The maximum amount of padding before the alignment is ignored.
- $supportedTokenizers : array<string|int, mixed>
- A list of tokenizers this sniff supports.
- checkAlignment() : int
- Processes this test, when one of its tokens is encountered.
- process() : int
- Processes this test, when one of its tokens is encountered.
- register() : array<string|int, mixed>
- Returns an array of tokens this test wants to listen for.
Properties
$alignAtEnd
Controls which side of the assignment token is used for alignment.
public
bool
$alignAtEnd
= true
$error
If true, an error will be thrown; otherwise a warning.
public
bool
$error
= false
$maxPadding
The maximum amount of padding before the alignment is ignored.
public
int
$maxPadding
= 1000
If the amount of padding required to align this assignment with the surrounding assignments exceeds this number, the assignment will be ignored and no errors or warnings will be thrown.
$supportedTokenizers
A list of tokenizers this sniff supports.
public
array<string|int, mixed>
$supportedTokenizers
= ['PHP', 'JS']
Methods
checkAlignment()
Processes this test, when one of its tokens is encountered.
public
checkAlignment(File $phpcsFile, int $stackPtr[, int $end = null ]) : int
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
- $end : int = null
-
The token where checking should end. If NULL, the entire file will be checked.
Return values
int —process()
Processes this test, when one of its tokens is encountered.
public
process(File $phpcsFile, int $stackPtr) : int
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
Return values
int —register()
Returns an array of tokens this test wants to listen for.
public
register() : array<string|int, mixed>