Documentation

FileHeaderSniff
in package
implements Sniff

Interfaces, Classes and Traits

Sniff

Table of Contents

getHeaderLines()  : array<string|int, mixed>
Gather information about the statements inside a possible file header.
process()  : int|null
Processes this sniff when one of its tokens is encountered.
processHeaderLines()  : int|null
Check the spacing and grouping of the statements inside each header block.
register()  : array<string|int, mixed>
Returns an array of tokens this test wants to listen for.

Methods

getHeaderLines()

Gather information about the statements inside a possible file header.

public getHeaderLines(File $phpcsFile, int $stackPtr) : array<string|int, mixed>
Parameters
$phpcsFile : File

The file being scanned.

$stackPtr : int

The position of the current token in the stack.

Return values
array<string|int, mixed>

process()

Processes this sniff when one of its tokens is encountered.

public process(File $phpcsFile, int $stackPtr) : int|null
Parameters
$phpcsFile : File

The file being scanned.

$stackPtr : int

The position of the current token in the stack.

Return values
int|null

processHeaderLines()

Check the spacing and grouping of the statements inside each header block.

public processHeaderLines(File $phpcsFile, array<string|int, mixed> $headerLines) : int|null
Parameters
$phpcsFile : File

The file being scanned.

$headerLines : array<string|int, mixed>

Header information, as sourced from getHeaderLines().

Return values
int|null

register()

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

public register() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results