Source Location: /PHP_CodeSniffer-3.0.0RC2/src/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php
$error = true
[line 53]
If true, an error will be thrown; otherwise a warning.
$forbiddenFunctionNames = array()
[line 39]
A cache of forbidden function names, for faster lookups.
$forbiddenFunctions = array(
'sizeof' => 'count',
'delete' => 'unset',
)
[line 29]
A list of forbidden functions with their alternatives.
The value is NULL if no alternative exists. IE, the function should just not be used.
- Var: string|null>
- Access: public
Type:
array
$patternMatch = false
[line 46]
If true, forbidden functions will be considered regular expressions.
Method Detail
addError [line 197]
void addError(
PHP_CodeSniffer_File
$phpcsFile, int
$stackPtr, string
$function, [string
$pattern = null])
Generates the error or warning for this sniff.
Parameters:
PHP_CodeSniffer_File
$phpcsFile
—
The file being scanned.
int
$stackPtr
—
The position of the forbidden function in the token array.
string
$function
—
The name of the forbidden function.
string
$pattern
—
The pattern used for the match.
process [line 109]
void process(
File
$phpcsFile, int
$stackPtr)
Processes this test, when one of its tokens is encountered.
Parameters:
PHP_CodeSniffer_File
$phpcsFile
—
The file being scanned.
int
$stackPtr
—
The position of the current token in the stack passed in $tokens.
register [line 61]
Returns an array of tokens this test wants to listen for.
Documentation generated on 2019年3月11日 14:49:41 -0400 by
phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.