1 | <?php |
||
13 | class JsonHelper |
||
14 | { |
||
15 | /** |
||
16 | * @var Decoder |
||
17 | */ |
||
18 | protected $decoder; |
||
19 | |||
20 | /** |
||
21 | * @var Encoder |
||
22 | */ |
||
23 | protected $encoder; |
||
24 | |||
25 | /** |
||
26 | * Get decoder |
||
27 | * |
||
28 | * @return Decoder |
||
29 | */ |
||
30 | public function getDecoder() |
||
37 | |||
38 | /** |
||
39 | * Get encoder |
||
40 | * |
||
41 | * @return Encoder |
||
42 | */ |
||
43 | public function getEncoder() |
||
50 | |||
51 | /** |
||
52 | * Encode value to json string |
||
53 | * |
||
54 | * @param mixed $value |
||
55 | * @return string |
||
56 | */ |
||
57 | public function encode($value) |
||
61 | |||
62 | /** |
||
63 | * Decode json string to value |
||
64 | * |
||
65 | * @param string $jsonString |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public function decode($jsonString) |
||
72 | } |