protected function VariableAnalysisSniff::processCompact in Coder 8.2
Called to process variables named in a call to compact().
Parameters
\PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where this: token was found.
int $stackPtr The position where the call to compact(): was found.
Return value
void
1 call to VariableAnalysisSniff::processCompact()
- VariableAnalysisSniff::process in coder_sniffer/
DrupalPractice/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - Processes this test, when one of its tokens is encountered.
File
- coder_sniffer/
DrupalPractice/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php, line 2197
Class
- VariableAnalysisSniff
- Checks the for undefined function variables.
Namespace
DrupalPractice\Sniffs\CodeAnalysisCode
protected function processCompact(File $phpcsFile, $stackPtr) {
$tokens = $phpcsFile
->getTokens();
$token = $tokens[$stackPtr];
$currScope = $this
->findVariableScope($phpcsFile, $stackPtr);
if (($arguments = $this
->findFunctionCallArguments($phpcsFile, $stackPtr)) !== false) {
$this
->processCompactArguments($phpcsFile, $stackPtr, $arguments, $currScope);
}
}