| Conditions | 9 |
| Paths | 8 |
| Total Lines | 17 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public static function render($value, bool $wrapValue = true, int $indentLevel = 0): string |
||
| 15 | { |
||
| 16 | switch (true) { |
||
| 17 | case $value === null: |
||
| 18 | return 'null'; |
||
| 19 | case is_bool($value): |
||
| 20 | return $value ? 'true' : 'false'; |
||
| 21 | case is_array($value): |
||
| 22 | return ArrayRenderer::render($value, $indentLevel); |
||
| 23 | case $value instanceof ExporterItem: |
||
| 24 | return $value->toString(); |
||
| 25 | case !$wrapValue || is_int($value): |
||
| 26 | return (string)$value; |
||
| 27 | case is_string($value): |
||
| 28 | return "'" . addslashes($value) . "'"; |
||
| 29 | default: |
||
| 30 | return "unserialize('" . addslashes(serialize($value)) . "')"; |
||
| 31 | } |
||
| 34 |