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"
请先登录再写评论。
Found an existing issue on this topic: https://youtrack.jetbrains.com/issue/WI-73911