ReservedFunctionNamesSniff
extends Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff
in package
All function and method names starting with double underscore are reserved by PHP.
PHP version All
Tags
Table of Contents
Methods
- __construct() : mixed
- Overload the constructor to work round various PHPCS cross-version compatibility issues.
- processTokenOutsideScope() : void
- Processes the tokens outside the scope.
- processTokenWithinScope() : void
- Processes the tokens within the scope.
- isFunctionDeprecated() : bool
- Check whether a function has been marked as deprecated via a @deprecated tag in the function docblock.
Methods
__construct()
Overload the constructor to work round various PHPCS cross-version compatibility issues.
public
__construct() : mixed
Tags
processTokenOutsideScope()
Processes the tokens outside the scope.
protected
processTokenOutsideScope(PHP_CodeSniffer_File $phpcsFile, int $stackPtr) : void
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file being processed.
- $stackPtr : int
-
The position where this token was found.
Tags
processTokenWithinScope()
Processes the tokens within the scope.
protected
processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, int $stackPtr, int $currScope) : void
Parameters
- $phpcsFile : PHP_CodeSniffer_File
-
The file being processed.
- $stackPtr : int
-
The position where this token was found.
- $currScope : int
-
The position of the current scope.
Tags
isFunctionDeprecated()
Check whether a function has been marked as deprecated via a @deprecated tag in the function docblock.
private
isFunctionDeprecated(File $phpcsFile, int $stackPtr) : bool
Parameters
- $phpcsFile : File
-
The file being scanned.
- $stackPtr : int
-
The position of a T_FUNCTION token in the stack.