1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Exit early if a bad class is detected

This commit is contained in:
Matt Brown 2017-09-11 11:55:50 -04:00
parent d1807cfb95
commit 439a1ddc97

View File

@ -101,12 +101,15 @@ class SwitchChecker
$file_checker = $statements_checker->getFileChecker();
if ($type_type instanceof Type\Atomic\GetClassT) {
ClassLikeChecker::checkFullyQualifiedClassLikeName(
$file_checker->project_checker,
$fq_classlike_name,
new CodeLocation($file_checker, $case->cond),
$statements_checker->getSuppressedIssues()
);
if (ClassLikeChecker::checkFullyQualifiedClassLikeName(
$file_checker->project_checker,
$fq_classlike_name,
new CodeLocation($file_checker, $case->cond),
$statements_checker->getSuppressedIssues()
) === false
) {
return false;
}
} elseif (!isset(ClassLikeChecker::$GETTYPE_TYPES[$fq_classlike_name])) {
if (IssueBuffer::accepts(
new UnevaluatedCode(