public function testWithTwoArgs() { $ratio = partial_left($this->ratio(), 2, 4); $this->assertSame(0.5, $ratio()); }
/** * Order is important. * * @param callable|mixed $pattern * @param callable|mixed $action * * @return static */ public function addCase($pattern, $action) { $this->cases[] = [is_callable($pattern) ? $pattern : partial_left($this->matcher, $pattern), is_callable($action) ? $action : const_function($action)]; return $this; }