1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Only emit one error for erroneous array_map string closure types

This commit is contained in:
Brown 2020-07-01 19:18:01 -04:00
parent 4d73b2501b
commit 6c62e46d15

View File

@ -700,6 +700,11 @@ class ArrayFunctionArgumentsAnalyzer
return;
}
// we pick up errors for string closures elsewhere
if ($method_id === 'array_map' && $closure_type instanceof Type\Atomic\TString) {
return;
}
foreach ($closure_params as $i => $closure_param) {
if (!isset($array_arg_types[$i])) {
continue;