1 | <?php |
||
10 | class Attribute extends AbstractBaseHtmlTagObject implements AttributeInterface |
||
11 | { |
||
12 | /** |
||
13 | * Store the attribute name. |
||
14 | * |
||
15 | * @var string|null |
||
16 | */ |
||
17 | private $name; |
||
18 | |||
19 | /** |
||
20 | * Store the attribute value. |
||
21 | * |
||
22 | * @var array|null |
||
23 | */ |
||
24 | private $values; |
||
25 | |||
26 | /** |
||
27 | * Attribute constructor. |
||
28 | * |
||
29 | * @param string $name |
||
30 | * The attribute name. |
||
31 | * @param string|string[]|mixed[] ...$values |
||
32 | * The attribute values. |
||
33 | */ |
||
34 | 41 | public function __construct($name, ...$values) |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 1 | public function offsetExists($offset) |
|
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 1 | public function offsetGet($offset) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 1 | public function offsetSet($offset, $value) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 1 | public function offsetUnset($offset) |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 8 | public function set(...$value) |
|
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | 33 | public function getName() |
|
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 33 | public function getValuesAsArray() |
|
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | 29 | public function render() |
|
110 | |||
111 | /** |
||
112 | * Sanitize a value. |
||
113 | * |
||
114 | * @param string|null $value |
||
115 | * The value to sanitize |
||
116 | * |
||
117 | * @return string |
||
118 | * The value sanitized. |
||
119 | */ |
||
120 | 33 | protected function sanitize($value) |
|
124 | |||
125 | /** |
||
126 | * {@inheritdoc} |
||
127 | */ |
||
128 | 1 | public function __toString() |
|
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | */ |
||
136 | 1 | public function isBoolean() |
|
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | 28 | public function append(...$value) |
|
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | 5 | public function remove(...$value) |
|
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | 2 | public function replace($original, ...$replacement) |
|
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | 5 | public function contains(...$substring) |
|
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | 2 | public function setBoolean($boolean = true) |
|
208 | |||
209 | /** |
||
210 | * {@inheritdoc} |
||
211 | */ |
||
212 | 1 | public function delete() |
|
219 | |||
220 | /** |
||
221 | * {@inheritdoc} |
||
222 | */ |
||
223 | 1 | public function alter(callable ...$closures) |
|
236 | |||
237 | /** |
||
238 | * {@inheritdoc} |
||
239 | */ |
||
240 | 1 | public function serialize() |
|
247 | |||
248 | /** |
||
249 | * {@inheritdoc} |
||
250 | */ |
||
251 | 1 | public function unserialize($serialized) |
|
258 | } |
||
259 |