Is there any way to pass parameters in doc from callable to function baz $params? I need give parameters in array associated by its names.
interface Bar {
/**
* @template TResult of mixed
* @template TParam of mixed
*
* @param callable(TParam...):TResult $callable
* @param array<array-key,TParam> $params
*
* @return TResult
*/
public function baz( callable $callable, array $params ): mixed;
}
/** @var Bar $bar */
$bar = '...';
$bar->baz(
fn( int $a, float $b, ?bool $c = null ) => $a, // phpstan error here
[ 'a' => 1, 'b' => .1, 'c' => null ]
);
phpstan error: phpstan: Parameter #1 $callable of method Bar::baz() expects callable(float|int|null ...): int, Closure(int, float, bool|null=): int given.