DisallowSizeFunctionsInLoopsSniff
in package
implements
Sniff
Table of Contents
Interfaces
Constants
- FORBIDDEN_FUNCTIONS = ['sizeof' => true, 'strlen' => true, 'count' => true]
- An array of functions we don't want in the condition of loops.
Properties
- $forbiddenFunctions : array<string, true>
- An array of functions we don't want in the condition of loops.
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.
Constants
FORBIDDEN_FUNCTIONS
An array of functions we don't want in the condition of loops.
protected
array<string, true>
FORBIDDEN_FUNCTIONS
= ['sizeof' => true, 'strlen' => true, 'count' => true]
Properties
$forbiddenFunctions
An array of functions we don't want in the condition of loops.
Use the DisallowSizeFunctionsInLoopsSniff::FORBIDDEN_FUNCTIONS constant instead.
protected
array<string, true>
$forbiddenFunctions
= self::FORBIDDEN_FUNCTIONS
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>