BracketSpacingSniff
in package
implements
Sniff
Requires a configurable number of spaces on the inside of attribute block brackets.
When newlines are allowed, will also safeguard against blank lines at the start/end of the attribute block.
Tags
Table of Contents
Interfaces
Constants
- METRIC_NAME : string = 'Spaces on the inside of attribute brackets'
- Name of the metric.
Properties
- $ignoreNewlines : bool
- Allow newlines instead of spaces.
- $spacing : int
- The amount of spacing to demand on the inside of attribute brackets.
Methods
- process() : void
- Processes this test, when one of its tokens is encountered.
- processCloser() : void
- Processes the attribute block closer bracket.
- processOpener() : void
- Processes the attribute block opener bracket.
- register() : array<string|int, int|string>
- Returns an array of tokens this test wants to listen for.
Constants
METRIC_NAME
Name of the metric.
public
string
METRIC_NAME
= 'Spaces on the inside of attribute brackets'
Tags
Properties
$ignoreNewlines
Allow newlines instead of spaces.
public
bool
$ignoreNewlines
= false
Tags
$spacing
The amount of spacing to demand on the inside of attribute brackets.
public
int
$spacing
= 0
Tags
Methods
process()
Processes this test, when one of its tokens is encountered.
public
process(File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the current token in the stack passed in $tokens.
Tags
processCloser()
Processes the attribute block closer bracket.
public
processCloser(File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the attribute block closer in the stack passed in $tokens.
Tags
processOpener()
Processes the attribute block opener bracket.
public
processOpener(File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of the attribute block opener in the stack passed in $tokens.
Tags
register()
Returns an array of tokens this test wants to listen for.
public
register() : array<string|int, int|string>