1 | <?php |
||
7 | abstract class Rule |
||
8 | { |
||
9 | use RuleChainTrait; |
||
10 | |||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $options; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $message; |
||
20 | |||
21 | /** |
||
22 | * Rule constructor. |
||
23 | * |
||
24 | * @param array $options |
||
25 | */ |
||
26 | 13 | public function __construct(array $options = []) |
|
30 | |||
31 | /** |
||
32 | * @return array |
||
33 | */ |
||
34 | 9 | public function getOptions(): array |
|
38 | |||
39 | /** |
||
40 | * @param string $name |
||
41 | * @param mixed $default |
||
42 | * |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 6 | public function getOption(string $name, $default = null) |
|
49 | |||
50 | /** |
||
51 | * @param string $name |
||
52 | * @param $value |
||
53 | * |
||
54 | * @return Rule |
||
55 | */ |
||
56 | 2 | public function setOption(string $name, $value): self |
|
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getMessage(): string |
||
70 | |||
71 | /** |
||
72 | * @param string $message |
||
73 | * |
||
74 | * @return Rule |
||
75 | */ |
||
76 | public function setMessage(string $message): self |
||
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | 2 | public function validatedBy(): string |
|
90 | } |
||
91 |