NonExecutableCodeSniff
in package
implements
Sniff
Table of Contents
Interfaces
Constants
- EXPRESSION_TOKENS = [T_EXIT => T_EXIT, T_THROW => T_THROW]
- 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.
Constants
EXPRESSION_TOKENS
Tokens for terminating expressions, which can be used inline.
private
array<int, int>
EXPRESSION_TOKENS
= [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).
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>