Documentation

SyntaxSniff
in package
implements Sniff

Table of Contents

Interfaces

Sniff

Properties

$phpPath  : string
The path to the PHP version we are checking with.

Methods

process()  : int
Processes this test, when one of its tokens is encountered.
register()  : array<string|int, int|string>
Returns an array of tokens this test wants to listen for.
getPhpLintCommand()  : string
Returns the command used to lint PHP code.

Properties

$phpPath

The path to the PHP version we are checking with.

private string $phpPath = null

Methods

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, int|string>
Return values
array<string|int, int|string>

getPhpLintCommand()

Returns the command used to lint PHP code.

private getPhpLintCommand(File $phpcsFile) : string

Uses a different command when the content is provided via STDIN.

Parameters
$phpcsFile : File

The File object.

Return values
string

The command used to lint PHP code.


        
On this page

Search results