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:
parent
2188b6736f
commit
bb46c30e38
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user