Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. VariableAnalysisSniff.php

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

VariableAnalysisSniff

Namespace

VariableAnalysis\Sniffs\CodeAnalysis

Code

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);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal