1 | <?php |
||
7 | class JsonBody extends Body |
||
8 | { |
||
9 | /** |
||
10 | * @var JsonObject |
||
11 | */ |
||
12 | private $json = []; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $jsonString = ''; |
||
18 | |||
19 | /** |
||
20 | * @param string $jsonString |
||
21 | */ |
||
22 | public function __construct($jsonString) |
||
27 | |||
28 | /** |
||
29 | * @return bool |
||
30 | */ |
||
31 | public function isJson(): bool |
||
35 | |||
36 | /** |
||
37 | * @param string $selector |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function has(string $selector): bool |
||
44 | |||
45 | /** |
||
46 | * @param string $selector |
||
47 | * @return \Kartenmacherei\RestFramework\JsonArray|JsonObject |
||
48 | */ |
||
49 | public function query(string $selector) |
||
53 | |||
54 | /** |
||
55 | * @return JsonObject |
||
56 | */ |
||
57 | public function getJson(): JsonObject |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getEncodedString(): string |
||
69 | |||
70 | /** |
||
71 | * @param string $jsonString |
||
72 | * @return JsonObject |
||
73 | * @throws EnsureException |
||
74 | */ |
||
75 | private function decode(string $jsonString): JsonObject |
||
83 | |||
84 | } |
||
85 |