1 | <?php |
||
22 | abstract class CompositeSpecification implements SpecificationInterface, PrunableInterface |
||
23 | { |
||
24 | /** |
||
25 | * Returns a specification that satisfies the original specification |
||
26 | * as well as the other specification |
||
27 | 1 | * @param SpecificationInterface $other |
|
28 | * @return AndSpecification |
||
29 | 1 | */ |
|
30 | public function andSpecification(SpecificationInterface $other) : AndSpecification |
||
34 | |||
35 | /** |
||
36 | 1 | * Returns a specification that satisfies the original specification |
|
37 | * or the other specification |
||
38 | 1 | * @param SpecificationInterface $other |
|
39 | * @return OrSpecification |
||
40 | */ |
||
41 | public function orSpecification(SpecificationInterface $other) : OrSpecification |
||
45 | 1 | ||
46 | /** |
||
47 | 1 | * Returns a specification that is the inverse of the original specification |
|
48 | * i.e. does not meet the original criteria |
||
49 | */ |
||
50 | public function notSpecification() : NotSpecification |
||
54 | |||
55 | /** {@inheritDoc} */ |
||
56 | public function canBeSatisfiedBySomethingBelow(array $value): bool |
||
60 | |||
61 | /** {@inheritDoc} */ |
||
62 | public function willBeSatisfiedByEverythingBelow(array $value): bool |
||
66 | |||
67 | /** |
||
68 | * Provide default {@see canBeSatisfiedBySomethingBelow()} logic for specification classes |
||
69 | * that don't implement PrunableInterface |
||
70 | */ |
||
71 | public static function thatCanBeSatisfiedBySomethingBelow(SpecificationInterface $that, array $value): bool |
||
78 | |||
79 | /** |
||
80 | * Provide default {@see willBeSatisfiedByEverythingBelow()} logic for specification classes |
||
81 | * that don't implement PrunableInterface |
||
82 | */ |
||
83 | public static function thatWillBeSatisfiedByEverythingBelow(SpecificationInterface $that, array $value): bool |
||
89 | } |
||
90 |