v2.0.0
Breaking changes
- Auto-curry option removed from
Dash::setCustom()
: The optional third parameter,$makeCurryable
, allowed custom methods to be auto-curried by prefixing them with an underscore when invoking them on a chain (eg.->_fooBar()
). However, in v1.0.0, underscore-prefixing of curried functions was replaced with a newDash\Curry
namespace, so this behavior is no longer consistent with the built-in currying semantics. To replicate this behavior, useDash\curry()
withDash\thru()
:
$greet = function($greeting, $name) { return "$greeting, $name"; };
Dash\Dash::setCustom('greet', $greet);
// Previously:
$greetings = Dash\chain('John')
->_greet('Hello')
->value();
// Now:
$greetings = Dash\chain('John')
->thru(Dash\curry($greet, 'Hello'))
->value();
// $greetings === 'Hello, John'