1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Don’t disable class checks if extension is loaded

This commit is contained in:
Brown 2018-10-04 16:58:11 -04:00
parent 9ea2009cd2
commit 289f5046b2

View File

@ -493,7 +493,14 @@ class FunctionCallChecker extends \Psalm\Checker\Statements\Expression\CallCheck
$context->phantom_files[$var_id] = true;
}
} elseif ($function->parts === ['extension_loaded']) {
$context->check_classes = false;
if ($first_arg
&& $first_arg->value instanceof PhpParser\Node\Scalar\String_
&& @extension_loaded($first_arg->value->value)
) {
// do nothing
} else {
$context->check_classes = false;
}
} elseif ($function->parts === ['function_exists']) {
$context->check_functions = false;
} elseif ($function->parts === ['is_callable']) {