icecave/evoke

A library for invoking PHP callables using positional and named arguments.

Installs: 56

Dependents: 0

Stars: 3

Watchers: 1

Open Issues: 1

Language: PHP

1.0.0 2014-09-09 04:59 UTC

README

Build Status Test Coverage SemVer

Evoke is a small PHP library for invoking callables using positional and named parameters, a little like Python's *args, **kwargs syntax.

Example

use Icecave\Evoke\Invoker;

$invoker = new Invoker;

$func = function ($a, $b, $c = 30, $d) {
    return array($a, $b, $c, $d);
};

$positionalArguments = array(10, 20);
$keywordArguments = array('d' => '40');

$result = $invoker->invoke($func, $positionalArguments, $keywordArguments);

assert($result === array(10, 20, 30, 40));

Contact us