/** * Filters a value through a set of functions. * * @param mixed $value Value. * @param array $filters Filters. * @return mixed Filtered value. */ private function filter($value, array $filters) { return Traverse::reduce($filters, new Execute(), $value); }
/** * */ public function testEvery() { $data = [1, 2]; $closure = $this->closure([[1, 0, false]]); $this->assertFalse(Traverse::every($data, $closure)); $closure = $this->closure([[1, 0, true], [2, 1, true]]); $this->assertTrue(Traverse::every($data, $closure)); }