is this the correct way to doc block a callable's output in php 8.2?

47 views Asked by At

I would like to properly document a PHP 8.2 inline callable's output for an array of strings.

here's an example:

/** @var callable $params : Array<string> */
$params = fn() : array => array_map(
    $format(...),
    [
        $fieldId,
        $matchType->name,
        $value,
    ]
);

assuming $format(...) always returns a string, is this the correct syntax?

0

There are 0 answers