-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Feature request
Since PHP 7.4 we have support for short closures fn (int $x) => foo($x), but AFAIK PHPStan cannot infer return type of even these single-statement closures and mixed is considered to be return type. So in order to get type checking, return type must be explicitly specified, which makes the new concise syntax unnecessarily long again.
I think that PHPStan should infer the return type of short (and normal) closures, when none is explicitly set.
I can probably help with implementation, I just need a few pointers and confirmation that this feature makes sense to you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels