You are here

function VariableAnalysisSniff::scopeKey in Coder 8.2

Generate a scope key based on the current file.

Parameters

string $currScope:

Return value

string

1 call to VariableAnalysisSniff::scopeKey()
VariableAnalysisSniff::getScopeInfo in coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
Warning: this is an autovivifying get.

File

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

Class

VariableAnalysisSniff
Checks the for undefined function variables.

Namespace

DrupalPractice\Sniffs\CodeAnalysis

Code

function scopeKey($currScope) {
  if ($currScope === false) {
    $currScope = 'file';
  }
  if (isset($this->currentFile) === true) {
    return $this->currentFile
      ->getFilename() . ':' . $currScope;
  }
  else {
    return 'unknown file' . ':' . $currScope;
  }
}