toolkit

Invoke

Calls a function, matching available values to its parameters by name.

Invoke:: Phlat\Toolkit\Invoke 1 methods
  • call Calls $fn, matching $available values to its parameters by name - in whatever order $fn declares them, and skipping any it doesn't ask for.

Methods

Invoke::call(callable $fn, array $available): mixed

Calls $fn, matching $available values to its parameters by name - in whatever order $fn declares them, and skipping any it doesn't ask for.

Lets site-authored closures (controllers, routers, hooks) declare only the params they need, in any order.

Parameters (2)
$fn callable
$available array

Returns mixed

phlat/src/Toolkit/Invoke.php:19