| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public static function toJSON($object): string { |
||
| 22 | if (\is_object($object)) { |
||
| 23 | if (\method_exists($object, 'toArray')) { |
||
| 24 | $object = $object->toArray(); |
||
| 25 | } else { |
||
| 26 | $object = (array) $object; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | return \json_encode($object, \JSON_PRETTY_PRINT | \JSON_NUMERIC_CHECK); |
||
| 30 | } |
||
| 49 |