1 | <?php |
||
7 | class JsonSerializer implements Serializer |
||
8 | { |
||
9 | /** @var \NilPortugues\Serializer\JsonSerializer */ |
||
10 | protected $serializer; |
||
11 | |||
12 | /** |
||
13 | * JsonSerializer constructor. |
||
14 | */ |
||
15 | public function __construct() |
||
19 | |||
20 | /** |
||
21 | * Turns a data structure into a string that can be recovered. |
||
22 | * |
||
23 | * @param mixed $data |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | public function serialize($data) : string |
||
31 | |||
32 | /** |
||
33 | * Turns string data structure into an usable $data structure. |
||
34 | * |
||
35 | * @param string $data |
||
36 | * |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function unserialize(string $data) |
||
43 | } |
||
44 |