1 | <?php |
||
8 | abstract class AbstractBaseHtmlTagObject |
||
9 | { |
||
10 | /** |
||
11 | * Normalize the values. |
||
12 | * |
||
13 | * @param mixed $values |
||
14 | * The value to normalize. |
||
15 | * |
||
16 | * @return array |
||
17 | * The value normalized. |
||
18 | */ |
||
19 | public function normalizeValue($values) |
||
39 | |||
40 | /** |
||
41 | * Transform a multidimensional array into a flat array. |
||
42 | * |
||
43 | * We could use a iterator_to_array() with a custom RecursiveArrayIterator. |
||
44 | * But it seems to be even slower. |
||
45 | * |
||
46 | * @see http://php.net/manual/en/class.recursivearrayiterator.php#106519 |
||
47 | * |
||
48 | * @param mixed[] $array |
||
49 | * The input array. |
||
50 | * |
||
51 | * @return mixed[] |
||
52 | * The array with only one dimension. |
||
53 | */ |
||
54 | public function ensureFlatArray(array $array) |
||
73 | |||
74 | /** |
||
75 | * Make sure the value is an array. |
||
76 | * |
||
77 | * @param mixed $data |
||
78 | * The input value. |
||
79 | * |
||
80 | * @return string|NULL |
||
81 | * The input value in an array. |
||
82 | */ |
||
83 | public function ensureString($data) |
||
109 | |||
110 | /** |
||
111 | * Preprocess values before they are returned to user. |
||
112 | * |
||
113 | * @param array $values |
||
114 | * The raw values. |
||
115 | * @param string $name |
||
116 | * The name of the object. |
||
117 | * |
||
118 | * @return array|\drupol\htmltag\Attribute\AttributeInterface[] |
||
119 | * The values. |
||
120 | */ |
||
121 | public function preprocess(array $values, $name = null) |
||
125 | |||
126 | /** |
||
127 | * Sanitize a value. |
||
128 | * |
||
129 | * @param string|null $value |
||
130 | * The value to sanitize |
||
131 | * |
||
132 | * @return string |
||
133 | * The value sanitized. |
||
134 | */ |
||
135 | abstract protected function escape($value); |
||
136 | } |
||
137 |