| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function toHtml($json) |
||
| 23 | { |
||
| 24 | // convert the json to an associative array |
||
| 25 | $input = json_decode($json, true); |
||
| 26 | $html = ''; |
||
| 27 | |||
| 28 | // loop trough the data blocks |
||
| 29 | foreach ($input['data'] as $block) { |
||
| 30 | $toHtmlContext = new ToHtmlContext($block['type']); |
||
| 31 | $html .= $toHtmlContext->getHtml($block['data']); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $html; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |