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

Breadcrumb

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

function ScopeManager::recordScopeStartAndEnd

* Add a scope's start and end index to our record for the file. * *

Parameters

File $phpcsFile: * @param int $scopeStartIndex * * @return ScopeInfo

File

vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/ScopeManager.php, line 30

Class

ScopeManager

Namespace

VariableAnalysis\Lib

Code

public function recordScopeStartAndEnd(File $phpcsFile, $scopeStartIndex) {
    $scopeEndIndex = Helpers::getScopeCloseForScopeOpen($phpcsFile, $scopeStartIndex);
    $filename = $phpcsFile->getFilename();
    if (!isset($this->scopes[$filename])) {
        $this->scopes[$filename] = [];
    }
    Helpers::debug('recording scope for file', $filename, 'start/end', $scopeStartIndex, $scopeEndIndex);
    $scope = new ScopeInfo($scopeStartIndex, $scopeEndIndex);
    $this->scopes[$filename][$scopeStartIndex] = $scope;
    return $scope;
}

API Navigation

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