From 29e78c5df18860366317a9eec24193da31ec4a59 Mon Sep 17 00:00:00 2001 From: Brown Date: Mon, 8 Oct 2018 13:08:03 -0400 Subject: [PATCH] Avoid not checking classes where possible --- .../Expression/Call/FunctionCallChecker.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Psalm/Checker/Statements/Expression/Call/FunctionCallChecker.php b/src/Psalm/Checker/Statements/Expression/Call/FunctionCallChecker.php index 52a072f8a..09f400edf 100644 --- a/src/Psalm/Checker/Statements/Expression/Call/FunctionCallChecker.php +++ b/src/Psalm/Checker/Statements/Expression/Call/FunctionCallChecker.php @@ -483,8 +483,6 @@ class FunctionCallChecker extends \Psalm\Checker\Statements\Expression\CallCheck } elseif ($function->parts === ['class_exists']) { if ($first_arg && $first_arg->value instanceof PhpParser\Node\Scalar\String_) { $context->phantom_classes[strtolower($first_arg->value->value)] = true; - } else { - $context->check_classes = false; } } elseif ($function->parts === ['file_exists'] && $first_arg) { $var_id = ExpressionChecker::getArrayVarId($first_arg->value, null); @@ -495,11 +493,12 @@ class FunctionCallChecker extends \Psalm\Checker\Statements\Expression\CallCheck } elseif ($function->parts === ['extension_loaded']) { if ($first_arg && $first_arg->value instanceof PhpParser\Node\Scalar\String_ - && @extension_loaded($first_arg->value->value) ) { - // do nothing - } else { - $context->check_classes = false; + if (@extension_loaded($first_arg->value->value)) { + // do nothing + } else { + $context->check_classes = false; + } } } elseif ($function->parts === ['function_exists']) { $context->check_functions = false;