Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function formatContent($content, $attributes = []): string |
||
10 | { |
||
11 | if (\is_string($content)) { |
||
12 | return $content; |
||
13 | } |
||
14 | |||
15 | if (!\is_array($content)) { |
||
16 | return \var_export($content, true); |
||
17 | } |
||
18 | |||
19 | $res = ''; |
||
20 | foreach ($content as $k => $v) { |
||
21 | $res .= $k.': ' . (\is_array($v) ? \implode(',', $v) : $v) . "\n"; |
||
22 | } |
||
23 | |||
24 | return $res; |
||
25 | } |
||
26 | } |
||
27 |