1 | <?php declare(strict_types=1); |
||
34 | final class Required extends BaseRule |
||
35 | { |
||
36 | /** |
||
37 | * State key. |
||
38 | */ |
||
39 | private const STATE_HAS_BEEN_CALLED = self::STATE_LAST + 1; |
||
40 | |||
41 | /** |
||
42 | * @var RuleInterface |
||
43 | */ |
||
44 | private $rule; |
||
45 | |||
46 | /** |
||
47 | * @param RuleInterface $rule |
||
48 | */ |
||
49 | 2 | public function __construct(RuleInterface $rule) |
|
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 2 | public function toBlock(): ExecutionBlockInterface |
|
70 | |||
71 | /** |
||
72 | * @param mixed $value |
||
73 | * @param ContextInterface $context |
||
74 | * |
||
75 | * @return array |
||
76 | * |
||
77 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
78 | */ |
||
79 | 1 | public static function execute($value, ContextInterface $context): array |
|
85 | |||
86 | /** |
||
87 | * @param ContextInterface $context |
||
88 | * |
||
89 | * @return array |
||
90 | * |
||
91 | * @SuppressWarnings(PHPMD.StaticAccess) |
||
92 | */ |
||
93 | 1 | public static function end(ContextInterface $context): array |
|
100 | |||
101 | /** |
||
102 | * @return RuleInterface |
||
103 | */ |
||
104 | 2 | public function getRule(): RuleInterface |
|
108 | } |
||
109 |