Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 20, 2021
1 parent e93e532 commit 4335711
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Psalm/Internal/Analyzer/ClosureAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ public static function analyzeExpression(
$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) {
Expand Down

0 comments on commit 4335711

Please sign in to comment.