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 = []; |
||
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 = []) |
|
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) |
|
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | 2 | public function delete(...$name) |
|
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | 1 | public function without(...$key) |
|
146 | |||
147 | /** |
||
148 | * {@inheritdoc} |
||
149 | */ |
||
150 | 1 | public function replace($key, $value, ...$replacement) |
|
164 | |||
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | 1 | public function merge(array $data = []) |
|
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | 1 | public function exists($key, $value = null) |
|
192 | |||
193 | /** |
||
194 | * {@inheritdoc} |
||
195 | */ |
||
196 | 3 | public function contains($key, ...$value) |
|
204 | |||
205 | /** |
||
206 | * {@inheritdoc} |
||
207 | */ |
||
208 | 5 | public function __toString() |
|
212 | |||
213 | /** |
||
214 | * {@inheritdoc} |
||
215 | */ |
||
216 | 16 | public function render() |
|
222 | |||
223 | /** |
||
224 | * {@inheritdoc} |
||
225 | */ |
||
226 | 1 | public function getStorage() |
|
230 | |||
231 | /** |
||
232 | * {@inheritdoc} |
||
233 | */ |
||
234 | 1 | public function getIterator() |
|
238 | |||
239 | /** |
||
240 | * {@inheritdoc} |
||
241 | */ |
||
242 | 1 | public function count() |
|
246 | |||
247 | /** |
||
248 | * {@inheritdoc} |
||
249 | */ |
||
250 | 18 | public function toArray() |
|
260 | |||
261 | /** |
||
262 | * {@inheritdoc} |
||
263 | */ |
||
264 | 18 | protected function preprocess(array $values, $name = null) |
|
276 | } |
||
277 |