1 | <?php |
||
16 | class Rule |
||
17 | { |
||
18 | /** @var string */ |
||
19 | private $rule; |
||
20 | |||
21 | /** @var Parser */ |
||
22 | private $parser; |
||
23 | |||
24 | /** @var Evaluator */ |
||
25 | private $evaluator; |
||
26 | |||
27 | /** @var string */ |
||
28 | private $parsedRule = ''; |
||
29 | |||
30 | /** @var string */ |
||
31 | private $error = ''; |
||
32 | |||
33 | 60 | public function __construct(string $rule, array $variables = []) |
|
58 | |||
59 | 4 | public function isTrue(): bool |
|
66 | |||
67 | 2 | public function isFalse(): bool |
|
71 | |||
72 | /** |
||
73 | * Tells whether a rule is valid (as in "can be parsed without error") or not. |
||
74 | */ |
||
75 | 58 | public function isValid(): bool |
|
86 | |||
87 | 58 | public function getError(): string |
|
91 | } |
||
92 |