1 | <?php |
||
9 | abstract class Element implements ElementContract |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $name; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | * |
||
19 | * @see OptionsResolver::setDefault() |
||
20 | */ |
||
21 | protected $defaults = []; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | * |
||
26 | * @see OptionsResolver::setRequired() |
||
27 | */ |
||
28 | protected $required = []; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | * |
||
33 | * @see OptionsResolver::setAllowedTypes() |
||
34 | */ |
||
35 | protected $types = []; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | * |
||
40 | * @see OptionsResolver::setAllowedValues() |
||
41 | */ |
||
42 | protected $values = []; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $options = []; |
||
48 | |||
49 | /** |
||
50 | * @var OptionsResolver |
||
51 | */ |
||
52 | protected $resolver; |
||
53 | |||
54 | public function __construct(array $options = []) |
||
58 | |||
59 | public static function make(array $options = []): ElementContract |
||
63 | |||
64 | public function setOptions(array $options): ElementContract |
||
70 | |||
71 | public function getOptions(): array |
||
75 | |||
76 | public function resolve(): ElementContract |
||
82 | |||
83 | public function isValid(): bool |
||
93 | |||
94 | abstract public function render(): string; |
||
95 | |||
96 | public function toString(): string |
||
100 | |||
101 | public function __toString(): string |
||
105 | |||
106 | protected function optionsResolver(): OptionsResolver |
||
129 | } |
||
130 |