Skip to content

Commit f8e8b5f

Browse files
authored
Merge pull request #11 from sasezaki/attribute_null
attribute null check
2 parents 55d2ea8 + f193040 commit f8e8b5f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/TypedLocalVariableChecker.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ private static function filterStatementsVar(array $stmts): \Generator
7070
continue;
7171
}
7272

73-
yield $expr->expr->var->name => ['expr' => $expr->expr] + $expr->expr->getAttribute(self::CONTEXT_ATTRIBUTE_KEY);
73+
/** @var array{context_var: Union, statements_source: StatementsSource}|null $assign_variable_context */
74+
$assign_variable_context = $expr->expr->getAttribute(self::CONTEXT_ATTRIBUTE_KEY);
75+
if ($assign_variable_context === null) {
76+
continue;
77+
}
78+
79+
yield $expr->expr->var->name => ['expr' => $expr->expr] + $assign_variable_context;
7480
}
7581
}
7682

0 commit comments

Comments
 (0)