/** * return the count of the lowest countable object that is not equal to 0 * @return [type] [description] */ public function minCount() { $filtered = Arrays::filter(func_get_args(), function ($value) { return $value->count() != 0; }); return Arrays::min($filtered, function ($value) { return $value->count(); }); }
public function testCanGetMinValueFromAnArrayWithClosure() { $under = Arrays::min($this->arrayNumbers, function ($value) { return $value * -1; }); $this->assertEquals(-3, $under); }