function VariableAnalysisSniff::normalizeVarName in Coder 8.2
Remove special characters from the variable name.
Parameters
string $varName:
Return value
string
2 calls to VariableAnalysisSniff::normalizeVarName()
- VariableAnalysisSniff::processVariable in coder_sniffer/
DrupalPractice/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - Called to process normal member vars.
- VariableAnalysisSniff::processVariableInString in coder_sniffer/
DrupalPractice/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - Called to process variables found in double quoted strings.
File
- coder_sniffer/
DrupalPractice/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php, line 664
Class
- VariableAnalysisSniff
- Checks the for undefined function variables.
Namespace
DrupalPractice\Sniffs\CodeAnalysisCode
function normalizeVarName($varName) {
$varName = preg_replace('/[{}$]/', '', $varName);
return $varName;
}