| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Give\Vendors\StellarWP\FieldConditions\Contracts; |
| 6 |
|
| 7 |
use JsonSerializable; |
| 8 |
|
| 9 |
interface Condition extends JsonSerializable |
| 10 |
{ |
| 11 |
const LOGICAL_OPERATORS = ['and', 'or']; |
| 12 |
|
| 13 |
/** |
| 14 |
* Returns the logical operator for this condition. |
| 15 |
* |
| 16 |
* @since 1.0.0 |
| 17 |
* |
| 18 |
* @return 'and'|'or' |
| 19 |
*/ |
| 20 |
public function getLogicalOperator(): string; |
| 21 |
|
| 22 |
/** |
| 23 |
* Returns true if the condition passes. |
| 24 |
* |
| 25 |
* @param array<string, mixed> $values |
| 26 |
*/ |
| 27 |
public function passes(array $values): bool; |
| 28 |
|
| 29 |
/** |
| 30 |
* Returns true if the condition fails. |
| 31 |
* |
| 32 |
* @param array<string, mixed> $values |
| 33 |
*/ |
| 34 |
public function fails(array $values): bool; |
| 35 |
} |
| 36 |
|