Documentation

LongConditionClosingCommentSniff
in package
implements Sniff

Interfaces, Classes and Traits

Sniff

Table of Contents

$commentFormat  : string
The format the end comment should be in.
$lineLimit  : int
The length that a code block must be before requiring a closing comment.
$supportedTokenizers  : array<string|int, mixed>
A list of tokenizers this sniff supports.
$openers  : array<string|int, int>
The openers that we are interested in.
process()  : void
Processes this test, when one of its tokens is encountered.
register()  : array<string|int, mixed>
Returns an array of tokens this test wants to listen for.

Properties

$commentFormat

The format the end comment should be in.

public string $commentFormat = '//end %s'

The placeholder %s will be replaced with the type of condition opener.

$openers

The openers that we are interested in.

private static array<string|int, int> $openers = [T_SWITCH, T_IF, T_FOR, T_FOREACH, T_WHILE, T_TRY, T_CASE, T_MATCH]

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.

Return values
void

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