Documentation

BracketSpacingSniff
in package
implements Sniff

FinalYes

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
since
1.5.0

Table of Contents

Interfaces

Sniff

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
since
1.5.0

Properties

$ignoreNewlines

Allow newlines instead of spaces.

public bool $ignoreNewlines = false
Tags
since
1.5.0

$spacing

The amount of spacing to demand on the inside of attribute brackets.

public int $spacing = 0
Tags
since
1.5.0

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
since
1.5.0

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
since
1.5.0

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
since
1.5.0

register()

Returns an array of tokens this test wants to listen for.

public register() : array<string|int, int|string>
Tags
since
1.5.0
Return values
array<string|int, int|string>
On this page

Search results