1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Protect possibility of bad get_class call

This commit is contained in:
Matthew Brown 2016-08-09 19:14:50 -04:00
parent 24d67e9615
commit 8131f806d8

View File

@ -3233,7 +3233,7 @@ class StatementsChecker
}
}
if ($stmt->name instanceof PhpParser\Node\Name && $stmt->name->parts === ['get_class']) {
if ($stmt->name instanceof PhpParser\Node\Name && $stmt->name->parts === ['get_class'] && $stmt->args) {
$var = $stmt->args[0]->value;
if ($var instanceof PhpParser\Node\Expr\Variable && is_string($var->name)) {