1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Fix vimeo/psalm#5255 (#5256)

This commit is contained in:
Bruce Weirdan 2021-02-21 03:15:46 +02:00 committed by GitHub
parent 3106635953
commit 1f84fdf110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,7 +133,9 @@ class ClosureAnalyzer extends FunctionLikeAnalyzer
$context->vars_in_scope[$use_var_id] = Type::getMixed();
}
if ($statements_analyzer->data_flow_graph instanceof \Psalm\Internal\Codebase\VariableUseGraph) {
if ($statements_analyzer->data_flow_graph instanceof \Psalm\Internal\Codebase\VariableUseGraph
&& $context->hasVariable($use_var_id)
) {
$parent_nodes = $context->vars_in_scope[$use_var_id]->parent_nodes;
foreach ($parent_nodes as $parent_node) {