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

allow assertion to work on $var::class

This commit is contained in:
orklah 2021-11-04 20:44:42 +01:00
parent 5282e4728b
commit 834d831915

View File

@ -2565,7 +2565,9 @@ class AssertionFinder
$this_class_name,
$source
);
} elseif ($getclass_expr instanceof PhpParser\Node\Expr\ClassConstFetch) {
} elseif ($getclass_expr instanceof PhpParser\Node\Expr\ClassConstFetch
&& $getclass_expr->class instanceof PhpParser\Node\Expr
) {
$var_name = ExpressionIdentifier::getArrayVarId(
$getclass_expr->class,
$this_class_name,
@ -3268,7 +3270,9 @@ class AssertionFinder
$this_class_name,
$source
);
} elseif ($getclass_expr instanceof PhpParser\Node\Expr\ClassConstFetch) {
} elseif ($getclass_expr instanceof PhpParser\Node\Expr\ClassConstFetch
&& $getclass_expr->class instanceof PhpParser\Node\Expr
) {
$var_name = ExpressionIdentifier::getArrayVarId(
$getclass_expr->class,
$this_class_name,