1 | <?php declare(strict_types=1); |
||
29 | final class IfOperator extends BaseRule |
||
30 | { |
||
31 | /** |
||
32 | * @var callable |
||
33 | */ |
||
34 | private $condition; |
||
35 | |||
36 | /** |
||
37 | * @var RuleInterface|null |
||
38 | */ |
||
39 | private $onTrue; |
||
40 | |||
41 | /** |
||
42 | * @var RuleInterface|null |
||
43 | */ |
||
44 | private $onFalse; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | private $settings; |
||
50 | |||
51 | /** |
||
52 | * @param callable $condition |
||
53 | * @param RuleInterface|null $onTrue |
||
54 | * @param RuleInterface|null $onFalse |
||
55 | * @param array $settings |
||
56 | */ |
||
57 | 10 | public function __construct( |
|
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | 10 | public function toBlock(): ExecutionBlockInterface |
|
84 | |||
85 | /** |
||
86 | * @return RuleInterface|null |
||
87 | */ |
||
88 | 10 | public function getOnTrue() |
|
92 | |||
93 | /** |
||
94 | * @return RuleInterface|null |
||
95 | */ |
||
96 | 10 | public function getOnFalse() |
|
100 | |||
101 | /** |
||
102 | * @return callable |
||
103 | */ |
||
104 | 10 | public function getCondition(): callable |
|
108 | |||
109 | /** |
||
110 | * @return array |
||
111 | */ |
||
112 | 10 | public function getSettings(): array |
|
116 | } |
||
117 |