1 | <?php |
||
11 | class Attributes extends AbstractBaseHtmlTagObject implements AttributesInterface |
||
12 | { |
||
13 | /** |
||
14 | * Stores the attribute data. |
||
15 | * |
||
16 | * @var \drupol\htmltag\Attribute\AttributeInterface[] |
||
17 | */ |
||
18 | private $storage = array(); |
||
19 | |||
20 | /** |
||
21 | * The attribute factory. |
||
22 | * |
||
23 | * @var \drupol\htmltag\Attribute\AttributeFactoryInterface |
||
24 | */ |
||
25 | private $attributeFactory; |
||
26 | |||
27 | /** |
||
28 | * Attributes constructor. |
||
29 | * |
||
30 | * @param \drupol\htmltag\Attribute\AttributeFactoryInterface $attributeFactory |
||
31 | * The attribute factory. |
||
32 | * @param mixed[] $attributes |
||
33 | * The input attributes. |
||
34 | */ |
||
35 | 27 | public function __construct(AttributeFactoryInterface $attributeFactory, $attributes = array()) |
|
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | 27 | public function import($attributes) |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 8 | public function set($name, ...$value) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 2 | public function offsetGet($name) |
|
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | 1 | public function offsetSet($name, $value = null) |
|
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | 1 | public function offsetUnset($name) |
|
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | 2 | public function offsetExists($name) |
|
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | 14 | public function append($key, ...$value) |
|
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | 2 | public function remove($key, ...$value) |
|
126 | |||
127 | /** |
||
128 | * {@inheritdoc} |
||
129 | */ |
||
130 | 2 | public function delete(...$name) |
|
138 | |||
139 | /** |
||
140 | * {@inheritdoc} |
||
141 | */ |
||
142 | 1 | public function without(...$key) |
|
148 | |||
149 | /** |
||
150 | * {@inheritdoc} |
||
151 | */ |
||
152 | 1 | public function replace($key, $value, ...$replacement) |
|
166 | |||
167 | /** |
||
168 | * {@inheritdoc} |
||
169 | */ |
||
170 | 1 | public function merge(array $data = array()) |
|
182 | |||
183 | /** |
||
184 | * {@inheritdoc} |
||
185 | */ |
||
186 | 1 | public function exists($key, $value = null) |
|
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | 3 | public function contains($key, ...$value) |
|
210 | |||
211 | /** |
||
212 | * {@inheritdoc} |
||
213 | */ |
||
214 | 5 | public function __toString() |
|
218 | |||
219 | /** |
||
220 | * {@inheritdoc} |
||
221 | */ |
||
222 | 16 | public function render() |
|
228 | |||
229 | /** |
||
230 | * {@inheritdoc} |
||
231 | */ |
||
232 | 2 | public function toArray() |
|
249 | |||
250 | /** |
||
251 | * {@inheritdoc} |
||
252 | */ |
||
253 | 1 | public function getStorage() |
|
257 | |||
258 | /** |
||
259 | * {@inheritdoc} |
||
260 | */ |
||
261 | 1 | public function getIterator() |
|
265 | |||
266 | /** |
||
267 | * {@inheritdoc} |
||
268 | */ |
||
269 | 1 | public function count() |
|
273 | |||
274 | /** |
||
275 | * Returns all storage elements as an array. |
||
276 | * |
||
277 | * @return \drupol\htmltag\Attribute\AttributeInterface[] |
||
278 | * An associative array of attributes. |
||
279 | */ |
||
280 | 17 | private function prepareValues() |
|
309 | } |
||
310 |