Skip to content

Commit

Permalink
Scan configured global types
Browse files Browse the repository at this point in the history
  • Loading branch information
tscni committed May 4, 2023
1 parent 595388b commit 8c9b0ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ public function enterNode(PhpParser\Node $node): ?int
$var_id = '$' . $var->name;

$functionlike_node_scanner->storage->global_variables[$var_id] = true;

if (isset($this->codebase->config->globals[$var_id])) {
$var_type = Type::parseString($this->codebase->config->globals[$var_id]);
/** @psalm-suppress UnusedMethodCall */
$var_type->queueClassLikesForScanning($this->codebase, $this->file_storage);
}
}
}
}
Expand Down

0 comments on commit 8c9b0ee

Please sign in to comment.