HumHub Documentation (unofficial)

NonExecutableCodeSniff
in package
implements Sniff

Table of Contents

Interfaces

Sniff

Properties

$expressionTokens  : array<string|int, mixed>
Tokens for terminating expressions, which can be used inline.

Methods

process()  : void
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.

Properties

$expressionTokens

Tokens for terminating expressions, which can be used inline.

private array<string|int, mixed> $expressionTokens = [T_EXIT => T_EXIT, T_THROW => T_THROW]

This is in contrast to terminating statements, which cannot be used inline and would result in a parse error (which is not the concern of this sniff).

throw can be used as an expression since PHP 8.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.

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>

        
On this page

Search results