Skip to content

Commit 0cdaf57

Browse files
committed
Rename GLOBAL scopeType to prevent clash with T_GLOBAL
1 parent 24a8a67 commit 0cdaf57

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

VariableAnalysis/Lib/ScopeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class ScopeType {
66
const PARAM = 'param';
77
const BOUND = 'bound';
88
const LOCAL = 'local';
9-
const GLOBAL = 'global';
9+
const GLOBALSCOPE = 'global';
1010
const STATIC = 'static';
1111
}

VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ protected function processVariableAsGlobalDeclaration(File $phpcsFile, $stackPtr
972972
}
973973

974974
// It's a global declaration.
975-
$this->markVariableDeclaration($varName, ScopeType::GLOBAL, null, $stackPtr, $currScope);
975+
$this->markVariableDeclaration($varName, ScopeType::GLOBALSCOPE, null, $stackPtr, $currScope);
976976
return true;
977977
}
978978

@@ -1523,7 +1523,7 @@ protected function processScopeCloseForVariable(File $phpcsFile, VariableInfo $v
15231523
// of "unused variable" warnings.
15241524
return;
15251525
}
1526-
if ($varInfo->scopeType === ScopeType::GLOBAL && isset($varInfo->firstInitialized)) {
1526+
if ($varInfo->scopeType === ScopeType::GLOBALSCOPE && isset($varInfo->firstInitialized)) {
15271527
// If we imported this variable from the global scope, any further use of
15281528
// the variable, including assignment, should count as "variable use" for
15291529
// the purposes of "unused variable" warnings.

0 commit comments

Comments
 (0)