function VariableAnalysisSniff::processVariableAsSuperGlobal
* Process a superglobal variable that is being accessed. * * Can be called for any token and will return false if the variable is not * of this type. * *
Parameters
string $varName: * * @return bool
2 calls to VariableAnalysisSniff::processVariableAsSuperGlobal()
- VariableAnalysisSniff::processVariable in vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - * Process a normal variable in the code. * * Most importantly, this function determines if the variable use is a "read" * (using the variable for something) or a "write" (an assignment) or, * sometimes, both at once. * …
- VariableAnalysisSniff::processVariableInString in vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - * Called to process variables found in double quoted strings. * * Note that there may be more than one variable in the string, which will * result only in one call for the string. * *
File
-
vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php, line 989
Class
Namespace
VariableAnalysis\Sniffs\CodeAnalysisCode
protected function processVariableAsSuperGlobal($varName) {
$superglobals = [
'GLOBALS',
'_SERVER',
'_GET',
'_POST',
'_FILES',
'_COOKIE',
'_SESSION',
'_REQUEST',
'_ENV',
'argv',
'argc',
'http_response_header',
'HTTP_RAW_POST_DATA',
];
// Are we a superglobal variable?
return in_array($varName, $superglobals, true);
}