diff --git a/src/Psalm/Checker/Statements/Expression/FetchChecker.php b/src/Psalm/Checker/Statements/Expression/FetchChecker.php index ef2491368..539124a8e 100644 --- a/src/Psalm/Checker/Statements/Expression/FetchChecker.php +++ b/src/Psalm/Checker/Statements/Expression/FetchChecker.php @@ -617,7 +617,7 @@ class FetchChecker $statements_checker->getFileChecker(), new CodeLocation($statements_checker->getSource(), $stmt->class), $statements_checker->getSuppressedIssues() - ) === false) { + ) !== true) { return false; } } @@ -626,6 +626,8 @@ class FetchChecker $stmt->class->inferredType = $fq_class_name ? new Type\Union([new TNamedObject($fq_class_name)]) : null; } + + if ($fq_class_name && $context->check_classes && $context->check_variables &&