Edit: consensus has coalesced around the callable(type1, type2): returntype syntax
If we want to specify that a function receives a certain sort of closure, we should be able to use a type.
e.g.
/**
* @param Closure<string, int, int> $foo
*/
function takeClosure(Closure $foo) {
$a = $foo(3, 5);
}
// this is good
takeClosure(function(int $a, int $b) { return (string) ($a + $b); });
// this fails
takeClosure(function(int $a, string $b) { return (string) ($a + $b); });