1 | <?php |
||
12 | class Attributes extends AbstractBaseHtmlTagObject implements AttributesInterface |
||
13 | { |
||
14 | /** |
||
15 | * Stores the attribute data. |
||
16 | * |
||
17 | * @var \drupol\htmltag\Attribute\AttributeInterface[] |
||
18 | */ |
||
19 | private $storage = []; |
||
20 | |||
21 | /** |
||
22 | * The attribute factory. |
||
23 | * |
||
24 | * @var \drupol\htmltag\Attribute\AttributeFactoryInterface |
||
25 | */ |
||
26 | private $attributeFactory; |
||
27 | |||
28 | /** |
||
29 | * Attributes constructor. |
||
30 | * |
||
31 | * @param \drupol\htmltag\Attribute\AttributeFactoryInterface $attributeFactory |
||
32 | * The attribute factory. |
||
33 | * @param mixed[] $attributes |
||
34 | * The input attributes. |
||
35 | */ |
||
36 | 31 | public function __construct(AttributeFactoryInterface $attributeFactory, $attributes = []) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 31 | public function import($attributes) |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 10 | public function set($name, ...$value) |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 3 | public function offsetGet($name) |
|
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | 1 | public function offsetSet($name, $value = null) |
|
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | 1 | public function offsetUnset($name) |
|
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | 2 | public function offsetExists($name) |
|
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | 15 | public function append($key, ...$value) |
|
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | 2 | public function remove($key, ...$value) |
|
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | 2 | public function delete(...$name) |
|
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | 1 | public function without(...$key) |
|
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | 1 | public function replace($key, $value, ...$replacement) |
|
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | 1 | public function merge(array $data = []) |
|
177 | |||
178 | /** |
||
179 | * {@inheritdoc} |
||
180 | */ |
||
181 | 1 | public function exists($key, $value = null) |
|
193 | |||
194 | /** |
||
195 | * {@inheritdoc} |
||
196 | */ |
||
197 | 3 | public function contains($key, ...$value) |
|
205 | |||
206 | /** |
||
207 | * {@inheritdoc} |
||
208 | */ |
||
209 | 6 | public function __toString() |
|
213 | |||
214 | /** |
||
215 | * {@inheritdoc} |
||
216 | */ |
||
217 | 18 | public function render() |
|
235 | |||
236 | /** |
||
237 | * {@inheritdoc} |
||
238 | */ |
||
239 | 1 | public function getStorage() |
|
243 | |||
244 | /** |
||
245 | * {@inheritdoc} |
||
246 | */ |
||
247 | 1 | public function getIterator() |
|
251 | |||
252 | /** |
||
253 | * {@inheritdoc} |
||
254 | */ |
||
255 | 1 | public function count() |
|
259 | |||
260 | /** |
||
261 | * {@inheritdoc} |
||
262 | */ |
||
263 | 23 | public function toArray() |
|
278 | |||
279 | /** |
||
280 | * {@inheritdoc} |
||
281 | */ |
||
282 | 3 | public function getValuesAsArray() |
|
291 | |||
292 | /** |
||
293 | * {@inheritdoc} |
||
294 | */ |
||
295 | 1 | public function serialize() |
|
301 | |||
302 | /** |
||
303 | * {@inheritdoc} |
||
304 | */ |
||
305 | 1 | public function unserialize($serialized) |
|
318 | } |
||
319 |