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

Fix #3191 - don’t generate complex assertion from class-string

This commit is contained in:
Brown 2020-04-19 12:53:50 -04:00
parent 2188b6736f
commit bb46c30e38
2 changed files with 5 additions and 1 deletions

View File

@ -871,7 +871,7 @@ class AssertionFinder
throw new \UnexpectedValueException('$getclass_position value');
}
if ($getclass_expr instanceof PhpParser\Node\Expr\FuncCall) {
if ($getclass_expr instanceof PhpParser\Node\Expr\FuncCall && isset($getclass_expr->args[0])) {
$var_name = ExpressionAnalyzer::getArrayVarId(
$getclass_expr->args[0]->value,
$this_class_name,

View File

@ -47,6 +47,10 @@ class TClassString extends TString
return $this->getKey();
}
public function getAssertionString() {
return 'class-string';
}
/**
* @param string|null $namespace
* @param array<string> $aliased_classes