1 | <?php |
||
19 | final class NotPredicate implements PredicateDecorator |
||
20 | { |
||
21 | protected $predicate; |
||
22 | |||
23 | /** |
||
24 | * NotPredicate constructor. |
||
25 | * @param Predicate $predicate |
||
26 | */ |
||
27 | 3 | public function __construct(Predicate $predicate) |
|
31 | |||
32 | /** |
||
33 | * Gets the predicate being decorated. |
||
34 | * |
||
35 | * @return Predicate[] The predicate as the only element in an array. |
||
36 | */ |
||
37 | 1 | public function getPredicates() : array |
|
38 | { |
||
39 | 1 | return [$this->predicate]; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Evaluates the predicate returning the opposite to the stored predicate. |
||
44 | * |
||
45 | * @param mixed $value The input value. |
||
46 | * @return bool true if predicate returns false. |
||
47 | */ |
||
48 | 2 | public function __invoke($value) : bool |
|
52 | } |
||
53 |