MethodDeclarationSniff
extends AbstractScopeSniff
in package
Table of Contents
Methods
- __construct() : mixed
- Constructs a Squiz_Sniffs_Scope_MethodScopeSniff.
- process() : void|int
- Processes the tokens that this test is listening for.
- register() : array<string|int, int|string>
- The method that is called to register the tokens this test wishes to listen to.
- processTokenOutsideScope() : void
- Processes a token that is found within the scope that this test is listening to.
- processTokenWithinScope() : void
- Processes the function tokens within the class.
Methods
__construct()
Constructs a Squiz_Sniffs_Scope_MethodScopeSniff.
public
__construct() : mixed
process()
Processes the tokens that this test is listening for.
public
final process(File $phpcsFile, int $stackPtr) : void|int
Parameters
- $phpcsFile : File
-
The file where this token was found.
- $stackPtr : int
-
The position in the stack where this token was found.
Tags
Return values
void|int —Optionally returns a stack pointer. The sniff will not be
called again on the current file until the returned stack
pointer is reached. Return $phpcsFile->numTokens to skip
the rest of the file.
register()
The method that is called to register the tokens this test wishes to listen to.
public
final register() : array<string|int, int|string>
DO NOT OVERRIDE THIS METHOD. Use the constructor of this class to register for the desired tokens and scope.
Tags
Return values
array<string|int, int|string>processTokenOutsideScope()
Processes a token that is found within the scope that this test is listening to.
protected
processTokenOutsideScope(File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : File
-
The file where this token was found.
- $stackPtr : int
-
The position in the stack where this token was found.
processTokenWithinScope()
Processes the function tokens within the class.
protected
processTokenWithinScope(File $phpcsFile, int $stackPtr, int $currScope) : void
Parameters
- $phpcsFile : File
-
The file where this token was found.
- $stackPtr : int
-
The position where the token was found.
- $currScope : int
-
The current scope opener token.