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 | */ |
|
28 | public function andSpecification(SpecificationInterface $other) : AndSpecification |
||
32 | |||
33 | /** |
||
34 | * Returns a specification that satisfies the original specification |
||
35 | * or the other specification |
||
36 | 1 | */ |
|
37 | public function orSpecification(SpecificationInterface $other) : OrSpecification |
||
41 | |||
42 | /** |
||
43 | * Returns a specification that is the inverse of the original specification |
||
44 | * i.e. does not meet the original criteria |
||
45 | 1 | */ |
|
46 | public function notSpecification() : NotSpecification |
||
50 | |||
51 | /** {@inheritDoc} */ |
||
52 | public function canBeSatisfiedBySomethingBelow(array $value) : bool |
||
56 | |||
57 | /** {@inheritDoc} */ |
||
58 | public function willBeSatisfiedByEverythingBelow(array $value) : bool |
||
62 | |||
63 | /** |
||
64 | * Provide default {@see canBeSatisfiedBySomethingBelow()} logic for specification classes |
||
65 | * that don't implement PrunableInterface |
||
66 | * |
||
67 | * @param mixed[] $value |
||
68 | * |
||
69 | * @psalm-param array{basename: string, path: string, stream: resource, dirname: string, type: string, extension: string} $value |
||
70 | * @psalm-mutation-free |
||
71 | */ |
||
72 | 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 | * @param mixed[] $value |
||
84 | * |
||
85 | * @psalm-param array{basename: string, path: string, stream: resource, dirname: string, type: string, extension: string} $value |
||
86 | * @psalm-mutation-free |
||
87 | */ |
||
88 | public static function thatWillBeSatisfiedByEverythingBelow(SpecificationInterface $that, array $value) : bool |
||
93 | } |
||
94 |