function _partial($function, $arguments) { return Underscore::partial($function, $arguments); }
/** * @tags functions */ public function testPartial() { // it should provide a partial version of the function where last // arguments are already provided $fn = function ($who, $greet, $message) { return "{$greet} {$who}, {$message}"; }; $partial = _::partial($fn, ["Hello", "what a nice day"]); $this->string($partial('John'))->isEqualTo('Hello John, what a nice day'); $this->string($partial('Peter'))->isEqualTo('Hello Peter, what a nice day'); }