1
0
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:
Matt Brown 2018-03-06 14:11:32 -05:00
parent fac5554e13
commit 6d767de043
2 changed files with 12 additions and 0 deletions

View File

@ -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',

View File

@ -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',