1 | <?php |
||
9 | class Json implements JsonInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var HttpClient |
||
13 | */ |
||
14 | private $httpClient; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $endpoint = ''; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $additionalOptions = []; |
||
25 | |||
26 | /** |
||
27 | * @param array $options |
||
28 | */ |
||
29 | 12 | public function __construct(array $options = []) |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getEndpoint() |
|
59 | |||
60 | 5 | public function get($path, array $params = []) |
|
64 | |||
65 | 1 | public function post($path, array $postData = []) |
|
69 | |||
70 | 1 | public function put($path, array $putData = []) |
|
74 | |||
75 | 1 | public function delete($endpoint, array $data = []) |
|
79 | |||
80 | 1 | public function patch($endpoint, array $data = []) |
|
84 | |||
85 | /** |
||
86 | * @param string $method |
||
87 | * @param string $path |
||
88 | * @param array $options |
||
89 | * |
||
90 | * @throws InvalidJsonResponseBodyException |
||
91 | * @throws Exception |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | 7 | private function request($method, $path, $options) |
|
114 | |||
115 | /** |
||
116 | * @param ResponseInterface $response |
||
117 | * |
||
118 | * @throws InvalidJsonResponseBodyException |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | 6 | private function getJsonContentFromResponse(ResponseInterface $response) |
|
133 | } |
||
134 |