HumHub Documentation (unofficial)

ComplexVersionInterface

Complex Version Interface.

Interface to be implemented by sniffs using a multi-dimensional array of PHP features (functions, classes etc) being sniffed for with version information in sub-arrays.

Tags
since
7.1.0

Table of Contents

Methods

addError()  : void
Generates the error or warning for this item.
getErrorInfo()  : array<string|int, mixed>
Retrieve the relevant detail (version) information for use in an error message.
getItemArray()  : array<string|int, mixed>
Get the relevant sub-array for a specific item from a multi-dimensional array.
handleFeature()  : void
Handle the retrieval of relevant information and - if necessary - throwing of an error/warning for an item.

Methods

addError()

Generates the error or warning for this item.

public addError(PHP_CodeSniffer_File $phpcsFile, int $stackPtr, array<string|int, mixed> $itemInfo, array<string|int, mixed> $errorInfo) : void
Parameters
$phpcsFile : PHP_CodeSniffer_File

The file being scanned.

$stackPtr : int

The position of the relevant token in the stack.

$itemInfo : array<string|int, mixed>

Base information about the item.

$errorInfo : array<string|int, mixed>

Array with detail (version) information relevant to the item.

Tags
since
7.1.0

getErrorInfo()

Retrieve the relevant detail (version) information for use in an error message.

public getErrorInfo(array<string|int, mixed> $itemArray, array<string|int, mixed> $itemInfo) : array<string|int, mixed>
Parameters
$itemArray : array<string|int, mixed>

Version and other information about the item.

$itemInfo : array<string|int, mixed>

Base information about the item.

Tags
since
7.1.0
Return values
array<string|int, mixed>

getItemArray()

Get the relevant sub-array for a specific item from a multi-dimensional array.

public getItemArray(array<string|int, mixed> $itemInfo) : array<string|int, mixed>
Parameters
$itemInfo : array<string|int, mixed>

Base information about the item.

Tags
since
7.1.0
Return values
array<string|int, mixed>

Version and other information about the item.

handleFeature()

Handle the retrieval of relevant information and - if necessary - throwing of an error/warning for an item.

public handleFeature(PHP_CodeSniffer_File $phpcsFile, int $stackPtr, array<string|int, mixed> $itemInfo) : void
Parameters
$phpcsFile : PHP_CodeSniffer_File

The file being scanned.

$stackPtr : int

The position of the relevant token in the stack.

$itemInfo : array<string|int, mixed>

Base information about the item.

Tags
since
7.1.0

        
On this page

Search results