1 | <?php |
||
8 | abstract class AbstractBaseHtmlTagObject |
||
9 | { |
||
10 | /** |
||
11 | * Escape values. |
||
12 | * |
||
13 | * @param array $values |
||
14 | * The values to escape. |
||
15 | * |
||
16 | * @return array |
||
17 | * The values escaped. |
||
18 | */ |
||
19 | 42 | protected function escapeValues(array $values) |
|
26 | |||
27 | /** |
||
28 | * Normalize the values. |
||
29 | * |
||
30 | * @param mixed $values |
||
31 | * The value to normalize. |
||
32 | * |
||
33 | * @return array |
||
34 | * The value normalized. |
||
35 | */ |
||
36 | 42 | protected function normalizeValues($values) |
|
43 | |||
44 | /** |
||
45 | * Transform a multidimensional array into a flat array. |
||
46 | * |
||
47 | * We could use a iterator_to_array() with a custom RecursiveArrayIterator. |
||
48 | * But it seems to be even slower. |
||
49 | * |
||
50 | * @see http://php.net/manual/en/class.recursivearrayiterator.php#106519 |
||
51 | * |
||
52 | * @param mixed[] $array |
||
53 | * The input array. |
||
54 | * |
||
55 | * @return mixed[] |
||
56 | * The array with only one dimension. |
||
57 | */ |
||
58 | 42 | protected function ensureFlatArray(array $array) |
|
77 | |||
78 | /** |
||
79 | * Make sure the value is an array. |
||
80 | * |
||
81 | * @param mixed $data |
||
82 | * The input value. |
||
83 | * |
||
84 | * @return string|null |
||
85 | * The input value in an array. |
||
86 | */ |
||
87 | 44 | protected function ensureString($data) |
|
113 | |||
114 | /** |
||
115 | * Preprocess values before they are returned to user. |
||
116 | * |
||
117 | * @param array $values |
||
118 | * The raw values. |
||
119 | * @param string $name |
||
120 | * The name of the object. |
||
121 | * |
||
122 | * @return array|\drupol\htmltag\Attribute\AttributeInterface[] |
||
123 | * The values. |
||
124 | */ |
||
125 | 41 | public function preprocess(array $values, $name = null) |
|
129 | |||
130 | /** |
||
131 | * Sanitize a value. |
||
132 | * |
||
133 | * @param string|mixed $value |
||
134 | * The value to sanitize |
||
135 | * |
||
136 | * @return string|mixed |
||
137 | * The value sanitized. |
||
138 | */ |
||
139 | abstract protected function escape($value); |
||
140 | } |
||
141 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.