HumHub Documentation (unofficial)

JumbledIncrementerSniff
in package
implements Sniff

Table of Contents

Interfaces

Sniff

Methods

process()  : void
Processes this test, when one of its tokens is encountered.
register()  : array<string|int, int|string>
Registers the tokens that this sniff wants to listen for.
findIncrementers()  : array<string|int, string>
Get all used variables in the incrementer part of a for statement.

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.

register()

Registers the tokens that this sniff wants to listen for.

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

findIncrementers()

Get all used variables in the incrementer part of a for statement.

protected findIncrementers(array<int, array<string|int, mixed>> $tokens, array<string, mixed> $token) : array<string|int, string>
Parameters
$tokens : array<int, array<string|int, mixed>>

Array with all code sniffer tokens.

$token : array<string, mixed>

Current for loop token.

Return values
array<string|int, string>

List of all found incrementer variables.


        
On this page

Search results