PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / vendor / vendor-prefixed / stellarwp / field-conditions / src / Contracts / ConditionSet.php

ConditionSet.php in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at vendor/vendor-prefixed/stellarwp/field-conditions/src/Contracts/ConditionSet.php

100 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Give\Vendors\StellarWP\FieldConditions\Contracts;
6
7 use Closure;
8 use IteratorAggregate;
9 use JsonSerializable;
10
11 /**
12 * @template C of Condition
13 */
14 interface ConditionSet extends IteratorAggregate, JsonSerializable
15 {
16 /**
17 * Returns all conditions in the set.
18 *
19 * @since 1.0.0
20 *
21 * @return array<C>
22 */
23 public function getConditions(): array;
24
25 /**
26 * Returns true if the set has conditions.
27 *
28 * @since 1.1.0
29 */
30 public function hasConditions(): bool;
31
32 /**
33 * Add one or more conditions to the set;
34 *
35 * @since 1.0.0
36 *
37 * @param C ...$conditions
38 *
39 * @return void
40 */
41 public function append(...$conditions);
42
43 /**
44 * @since 1.1.2 make nullable parameters explicit for PHP 8.4 compatibility
45 * @since 1.0.0
46 *
47 * @param string|C|Closure $condition
48 * @param string|null $comparisonOperator
49 * @param mixed|null $value
50 */
51 public function where($condition, ?string $comparisonOperator = null, $value = null): self;
52
53 /**
54 * @since 1.1.2 make nullable parameters explicit for PHP 8.4 compatibility
55 * @since 1.0.0
56 *
57 * @param string|C|Closure $condition
58 * @param string|null $comparisonOperator
59 * @param mixed|null $value
60 */
61 public function and($condition, ?string $comparisonOperator = null, $value = null): self;
62
63 /**
64 * @since 1.1.2 make nullable parameters explicit for PHP 8.4 compatibility
65 * @since 1.0.0
66 *
67 * @param string|C|Closure $condition
68 * @param string|null $comparisonOperator
69 * @param mixed|null $value
70 */
71 public function or($condition, ?string $comparisonOperator = null, $value = null): self;
72
73 /**
74 * Returns true if all conditions in the set pass.
75 *
76 * @since 1.0.0
77 *
78 * @param array<string, mixed> $values
79 */
80 public function passes(array $values): bool;
81
82 /**
83 * Returns true if any condition in the set fails.
84 *
85 * @since 1.0.0
86 *
87 * @param array<string, mixed> $values
88 */
89 public function fails(array $values): bool;
90
91 /**
92 * Returns the conditions in array form for JSON serialization.
93 *
94 * @since 1.0.0
95 *
96 * @return list<array>
97 */
98 public function jsonSerialize(): array;
99 }
100