dev-master
9999999-devInvoke callables using associative arrays
BSD-3-Clause
The Requires
- php >=5.6
The Development Requires
invoke invoke args
Wallogit.com
2017 © Pedro Peláez
Invoke callables using associative arrays
Invoke PHP callables using associative arrays, (*1)
Use invoke providing a callable and the arguments as an associative array, (*3)
function person($name, $age)
{
}
$invoker = new Invoker();
$invoker->invoke('person', ['age' => 29, 'name' => 'Marco']);
Supports optional arguments, (*4)
function person($name, $age = 29)
{
}
$invoker = new Invoker();
$invoker->invoke('person', ['name' => 'Marco']);
In addition to PHP callables you can use the following forms as first argument:, (*5)
You can implement Resolver interface and inject it into Invoker's constructor for adding your own forms, (*6)
$invoker = new Invoker(new MyResolver());
Invoke callables using associative arrays
BSD-3-Clause
invoke invoke args