1 | <?php |
||
18 | trait Base |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $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 | * @param string $text |
||
54 | * @return static |
||
55 | */ |
||
56 | public function setText(string $text) |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getIdentifier(): string |
||
72 | |||
73 | /** |
||
74 | * @param string $identifier |
||
75 | * @return string |
||
76 | */ |
||
77 | public function setIdentifier(string $identifier): string |
||
82 | |||
83 | /** |
||
84 | * @return array |
||
85 | */ |
||
86 | public function properties(): array |
||
90 | |||
91 | /** |
||
92 | * @return array |
||
93 | */ |
||
94 | public function getProperties(): array |
||
104 | |||
105 | /** |
||
106 | * @inheritdoc |
||
107 | */ |
||
108 | public function settings(): array |
||
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | public function getSettings(): array |
||
126 | |||
127 | /** |
||
128 | * @param array $attributes |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getHtml(array $attributes = []): string |
||
151 | |||
152 | /** |
||
153 | * @return string |
||
154 | */ |
||
155 | public function __toString() |
||
159 | } |
||
160 |