mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Ignore nullable class strings where appropriate
This commit is contained in:
parent
fac5554e13
commit
6d767de043
@ -144,6 +144,12 @@ class NewChecker extends \Psalm\Checker\Statements\Expression\CallChecker
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($lhs_type_part instanceof Type\Atomic\TNull
|
||||
&& $stmt->class->inferredType->ignore_nullable_issues
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IssueBuffer::accepts(
|
||||
new UndefinedClass(
|
||||
'Type ' . $lhs_type_part . ' cannot be called as a class',
|
||||
|
@ -224,6 +224,12 @@ class StaticCallChecker extends \Psalm\Checker\Statements\Expression\CallChecker
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($lhs_type_part instanceof Type\Atomic\TNull
|
||||
&& $lhs_type->ignore_nullable_issues
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IssueBuffer::accepts(
|
||||
new UndefinedClass(
|
||||
'Type ' . $lhs_type_part . ' cannot be called as a class',
|
||||
|
Loading…
x
Reference in New Issue
Block a user