1 | <?php |
||
9 | class JsonParser implements ParserInterface, EnumInterface |
||
10 | { |
||
11 | use EnumTrait; |
||
12 | |||
13 | /** |
||
14 | * @var int |
||
15 | */ |
||
16 | const DECODE_DEFAULT = 2; |
||
17 | |||
18 | /** |
||
19 | * @var int |
||
20 | */ |
||
21 | const DECODE_OBJECT = 1; |
||
22 | |||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | const DECODE_ARRAY = 2; |
||
27 | |||
28 | /** |
||
29 | * @var int |
||
30 | */ |
||
31 | private $flags; |
||
32 | |||
33 | /** |
||
34 | * @param int $flags |
||
35 | */ |
||
36 | 3 | public function __construct($flags = self::DECODE_DEFAULT) |
|
40 | |||
41 | /** |
||
42 | * |
||
43 | */ |
||
44 | 3 | public function __destruct() |
|
48 | |||
49 | /** |
||
50 | * @override |
||
51 | * @inheritDoc |
||
52 | */ |
||
53 | 6 | public function encode($mixed) |
|
57 | |||
58 | /** |
||
59 | * @override |
||
60 | * @inheritDoc |
||
61 | */ |
||
62 | 1 | public function decode($str) |
|
75 | } |
||
76 |