1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Only say we could not infer param type if we’re actively looking

This commit is contained in:
Matthew Brown 2017-09-02 18:26:19 -04:00
parent 6531e3bfb8
commit a725009181

View File

@ -518,10 +518,13 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
$possible_type = $context->possible_param_types[$function_param->name];
}
$infer_text = $project_checker->infer_types_from_usage
? ', ' . ($possible_type ? 'should be ' . $possible_type : 'could not infer type')
: '';
IssueBuffer::accepts(
new UntypedParam(
'Parameter $' . $function_param->name . ' has no provided type, '
. ($possible_type ? 'should be ' . $possible_type : 'could not infer'),
'Parameter $' . $function_param->name . ' has no provided type' . $infer_text,
$function_param->location
),
$storage->suppressed_issues