function VariableAnalysisSniff::processScopeClose
* Called to process the end of a scope. * * Note that although triggered by the closing curly brace of the scope, * $stackPtr is the scope conditional, not the closing curly brace. * *
Parameters
File $phpcsFile The PHP_CodeSniffer file where this token was found.: * @param int $stackPtr The position of the scope conditional. * * @return void
1 call to VariableAnalysisSniff::processScopeClose()
- VariableAnalysisSniff::searchForAndProcessClosingScopesAt in vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php - * Find scopes closed by a token and process their variables. * * Calls `processScopeClose()` for each closed scope. * *
File
-
vendor/
sirbrillig/ phpcs-variable-analysis/ VariableAnalysis/ Sniffs/ CodeAnalysis/ VariableAnalysisSniff.php, line 1906
Class
Namespace
VariableAnalysis\Sniffs\CodeAnalysisCode
protected function processScopeClose(File $phpcsFile, $stackPtr) {
Helpers::debug("processScopeClose at {$stackPtr}");
$scopeInfo = $this->scopeManager
->getScopeForScopeStart($phpcsFile->getFilename(), $stackPtr);
if (is_null($scopeInfo)) {
return;
}
foreach ($scopeInfo->variables as $varInfo) {
$this->processScopeCloseForVariable($phpcsFile, $varInfo, $scopeInfo);
}
}