1 | <?php |
||
18 | trait Base |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | public $text; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $identifier; |
||
30 | |||
31 | /** |
||
32 | * @return string |
||
33 | */ |
||
34 | abstract public function getUrl(): string; |
||
35 | |||
36 | /** |
||
37 | * Returns the list of attribute names. |
||
38 | * By default, this method returns all public non-static properties of the class. |
||
39 | * You may override this method to change the default behavior. |
||
40 | * @return array list of attribute names. |
||
41 | */ |
||
42 | abstract protected function attributes(); |
||
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getText(): string |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getIdentifier(): string |
||
62 | |||
63 | /** |
||
64 | * @param string $identifier |
||
65 | * @return string |
||
66 | */ |
||
67 | public function setIdentifier(string $identifier): string |
||
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | public function properties(): array |
||
80 | |||
81 | /** |
||
82 | * @return array |
||
83 | */ |
||
84 | public function getProperties(): array |
||
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | public function settings(): array |
||
102 | |||
103 | /** |
||
104 | * @inheritdoc |
||
105 | */ |
||
106 | public function getSettings(): array |
||
116 | |||
117 | /** |
||
118 | * @param array $attributes |
||
119 | * @return string |
||
120 | */ |
||
121 | public function getHtml(array $attributes = []): string |
||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function __toString() |
||
149 | } |
||
150 |