| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 3 | protected function formatData(string $data): string |
|
| 33 | { |
||
| 34 | 3 | foreach ($this->wrappers as $tag => $attribute) { |
|
| 35 | 1 | if (is_array($attribute)) { |
|
| 36 | 1 | $fill = ''; |
|
| 37 | 1 | foreach ($attribute as $k => $v) { |
|
| 38 | 1 | $fill .= sprintf('%s="%s"', $k, $v); |
|
| 39 | } |
||
| 40 | } else { |
||
| 41 | 1 | $fill = $attribute; |
|
| 42 | } |
||
| 43 | 1 | $data = sprintf('<%s %s>%s</%s>', $tag, $fill, $data, $tag); |
|
| 44 | } |
||
| 45 | 3 | return $data; |
|
| 46 | } |
||
| 48 |