No Support for @param Generic Closure like Intelephense?

Hi, the following code works with Intelephense as in “$item” is correctly type-inferred as “int”.

Are generic closures straight up unsupported in PHPStorm or do i need to use a different syntax?

/** @template T */
class Collection {
    /**
     * @param Closure(T $element): bool $fn
     */
    function filter($fn) { /* ... */ }
}

/** @var Collection<int> $col */
$col;

$col->filter(fn($item) => $item > 5);
//                ^ should be type-inferred as "int"
1

请先登录再写评论。