You are here

function VariableAnalysisSniff::getScopeInfo in Coder 8.2

Warning: this is an autovivifying get.

Parameters

string|false $currScope:

bool $autoCreate:

Return value

ScopeInfo

2 calls to VariableAnalysisSniff::getScopeInfo()
VariableAnalysisSniff::getVariableInfo in coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
Get variable information for a given variable name.
VariableAnalysisSniff::processScopeClose in coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
Called to process the end of a scope.

File

coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php, line 702

Class

VariableAnalysisSniff
Checks the for undefined function variables.

Namespace

DrupalPractice\Sniffs\CodeAnalysis

Code

function getScopeInfo($currScope, $autoCreate = true) {
  $scopeKey = $this
    ->scopeKey($currScope);
  if (isset($this->_scopes[$scopeKey]) === false) {
    if ($autoCreate === false) {
      return null;
    }
    $this->_scopes[$scopeKey] = new ScopeInfo($currScope);
  }
  return $this->_scopes[$scopeKey];
}