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

Fix loading imported functions

This commit is contained in:
Matt Brown 2020-12-02 00:52:35 -05:00 committed by Daniil Gentili
parent b1996262ba
commit 0aeb0ef990
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -132,16 +132,14 @@ class FunctionCallAnalyzer extends CallAnalyzer
$set_inside_conditional = true; $set_inside_conditional = true;
} }
if (ArgumentsAnalyzer::analyze( ArgumentsAnalyzer::analyze(
$statements_analyzer, $statements_analyzer,
$stmt->args, $stmt->args,
$function_call_info->function_params, $function_call_info->function_params,
$function_call_info->function_id, $function_call_info->function_id,
$function_call_info->allow_named_args, $function_call_info->allow_named_args,
$context $context
) === false) { );
// fall through
}
if ($set_inside_conditional) { if ($set_inside_conditional) {
$context->inside_conditional = false; $context->inside_conditional = false;
@ -165,8 +163,8 @@ class FunctionCallAnalyzer extends CallAnalyzer
$template_result = new TemplateResult([], []); $template_result = new TemplateResult([], []);
// do this here to allow closure param checks // do this here to allow closure param checks
if ($function_call_info->function_params !== null if ($function_call_info->function_params !== null) {
&& ArgumentsAnalyzer::checkArgumentsMatch( ArgumentsAnalyzer::checkArgumentsMatch(
$statements_analyzer, $statements_analyzer,
$stmt->args, $stmt->args,
$function_call_info->function_id, $function_call_info->function_id,
@ -176,9 +174,7 @@ class FunctionCallAnalyzer extends CallAnalyzer
$template_result, $template_result,
$code_location, $code_location,
$context $context
) === false );
) {
// fall through
} }
CallAnalyzer::checkTemplateResult( CallAnalyzer::checkTemplateResult(
@ -432,6 +428,8 @@ class FunctionCallAnalyzer extends CallAnalyzer
} }
return $function_call_info; return $function_call_info;
} else {
$function_call_info->function_exists = true;
} }
} }
} else { } else {