| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class JsonSerializer implements Serializer |
||
| 6 | { |
||
| 7 | public static function serialize($data) { |
||
| 8 | return self::convert_to_json($data); |
||
| 9 | } |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Deserialize a json/xml string to an array |
||
| 13 | * |
||
| 14 | * @param string $xml_string |
||
| 15 | * |
||
| 16 | * @return mixed |
||
| 17 | */ |
||
| 18 | public static function deserialize($xml_string) { |
||
| 19 | |||
| 20 | return json_decode($xml_string, true); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Get the correct HTTP header for the given serialized output |
||
| 25 | * |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | public static function getHttpHeader() { |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param mixed $data |
||
| 34 | * |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | private static function convert_to_json($data) { |
||
| 45 | } |