1 | <?php namespace Limoncello\Validation\Blocks; |
||
27 | final class IfBlock implements IfExpressionInterface |
||
28 | { |
||
29 | use CheckCallableTrait; |
||
30 | |||
31 | /** |
||
32 | * @var callable |
||
33 | */ |
||
34 | private $condition; |
||
35 | |||
36 | /** |
||
37 | * @var ExecutionBlockInterface |
||
38 | */ |
||
39 | private $onTrue; |
||
40 | |||
41 | /** |
||
42 | * @var ExecutionBlockInterface |
||
43 | */ |
||
44 | private $onFalse; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | private $properties; |
||
50 | |||
51 | /** |
||
52 | * @param callable $condition |
||
53 | * @param ExecutionBlockInterface $onTrue |
||
54 | * @param ExecutionBlockInterface $onFalse |
||
55 | * @param array $properties |
||
56 | */ |
||
57 | 11 | public function __construct( |
|
70 | |||
71 | /** |
||
72 | * @inheritdoc |
||
73 | */ |
||
74 | 10 | public function getConditionCallable(): callable |
|
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | 10 | public function getOnTrue(): ExecutionBlockInterface |
|
86 | |||
87 | /** |
||
88 | * @inheritdoc |
||
89 | */ |
||
90 | 10 | public function getOnFalse(): ExecutionBlockInterface |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 11 | public function getProperties(): array |
|
102 | |||
103 | /** @noinspection PhpDocMissingThrowsInspection |
||
104 | * @param callable $procedureCallable |
||
105 | * |
||
106 | * @return bool |
||
107 | */ |
||
108 | 11 | private function checkConditionCallableSignature(callable $procedureCallable): bool |
|
113 | } |
||
114 |