public static function not($predicate) { return function ($object) use($predicate) { return !$predicate($object); }; }
/** * @test */ public function shouldNegatePredicate() { $this->assertFalse(Functions::call(Functions::not(Functions::identity()), true)); $this->assertTrue(Functions::call(Functions::not(Functions::identity()), false)); }