Re: [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*
Hello,
On Sun, 27 Jun 2021 at 19:09, Ralph Schindler <ralph@ralphschindler.com>
wrote:
>
> This proposes a method for a publisher/framework/producer (the caller of
> the callback) to document all the parameters that are available as named
> parameters, and subscribers/consumers (creator of the callback) could
> subscribe to what they need by name.
>
Wouldn't it rather be nice if we had more detailed callable types instead?
I mean instead of simply defining a parameter type as callable we could
specifically define what the callable expects.
Something like this:
```
function bar ((int, string):bool $callback) {...}
```
A more generic approach that could be more descriptive, maybe.
I have no clue if this was already discussed in other threads or not. And
whether it is feasible to implement.
Regards,
Thread (9 messages)