mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 12:24:49 +01:00
Add support for global stmts
This commit is contained in:
parent
b862073514
commit
9b507fe936
@ -171,6 +171,19 @@ class FunctionChecker
|
||||
$this->_aliased_classes[$use->alias] = implode('\\', $use->name->parts);
|
||||
}
|
||||
}
|
||||
else if ($stmt instanceof PhpParser\Node\Stmt\Global_) {
|
||||
foreach ($stmt->vars as $var) {
|
||||
if ($var instanceof PhpParser\Node\Expr\Variable) {
|
||||
if (is_string($var->name)) {
|
||||
$vars_in_scope[$var->name] = true;
|
||||
$vars_possibly_in_scope[$var->name] = true;
|
||||
}
|
||||
else {
|
||||
$this->_checkExpression($var, $vars_in_scope, $vars_possibly_in_scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var_dump('Unrecognised statement');
|
||||
var_dump($stmt);
|
||||
|
Loading…
Reference in New Issue
Block a user