1 | <?php |
||
10 | abstract class AbstractAttribute extends AbstractBaseHtmlTagObject implements AttributeInterface |
||
11 | { |
||
12 | /** |
||
13 | * Store the attribute name. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | private $name; |
||
18 | |||
19 | /** |
||
20 | * Store the attribute value. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | private $values; |
||
25 | |||
26 | /** |
||
27 | * Attribute constructor. |
||
28 | * |
||
29 | * @param string $name |
||
30 | * The attribute name |
||
31 | * @param mixed[]|string|string[] ...$values |
||
32 | * The attribute values. |
||
33 | */ |
||
34 | 47 | public function __construct($name, ...$values) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 20 | public function __toString() |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 1 | public function alter(callable ...$closures) |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 31 | public function append(...$value) |
|
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 5 | public function contains(...$substring) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 1 | public function delete() |
|
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | 5 | public function getName() |
|
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | 38 | public function getValuesAsArray() |
|
128 | |||
129 | /** |
||
130 | * {@inheritdoc} |
||
131 | */ |
||
132 | 34 | public function getValuesAsString() |
|
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | 1 | public function isBoolean() |
|
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | 1 | public function offsetExists($offset) |
|
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | 1 | public function offsetGet($offset) |
|
162 | |||
163 | /** |
||
164 | * {@inheritdoc} |
||
165 | */ |
||
166 | 1 | public function offsetSet($offset, $value) |
|
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | 1 | public function offsetUnset($offset) |
|
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | 5 | public function remove(...$value) |
|
191 | |||
192 | /** |
||
193 | * {@inheritdoc} |
||
194 | */ |
||
195 | 33 | public function render() |
|
201 | |||
202 | /** |
||
203 | * {@inheritdoc} |
||
204 | */ |
||
205 | 2 | public function replace($original, ...$replacement) |
|
216 | |||
217 | /** |
||
218 | * {@inheritdoc} |
||
219 | */ |
||
220 | 1 | public function serialize() |
|
227 | |||
228 | /** |
||
229 | * {@inheritdoc} |
||
230 | */ |
||
231 | 9 | public function set(...$value) |
|
237 | |||
238 | /** |
||
239 | * {@inheritdoc} |
||
240 | */ |
||
241 | 2 | public function setBoolean($boolean = true) |
|
247 | |||
248 | /** |
||
249 | * {@inheritdoc} |
||
250 | */ |
||
251 | 1 | public function unserialize($serialized) |
|
258 | |||
259 | /** |
||
260 | * Escape a value. |
||
261 | * |
||
262 | * @param null|string $value |
||
263 | * The value to sanitize |
||
264 | * |
||
265 | * @return mixed|string |
||
266 | * The value sanitized |
||
267 | */ |
||
268 | 31 | protected function escape($value) |
|
274 | } |
||
275 |