1 | <?php declare(strict_types=1); |
||
20 | class HttpAdapter extends AbstractClient implements SyncAdapterInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var Guzzle |
||
24 | */ |
||
25 | private $guzzle; |
||
26 | |||
27 | /** |
||
28 | * @var Client |
||
29 | */ |
||
30 | private $client; |
||
31 | |||
32 | /** |
||
33 | * HttpAdapter constructor. |
||
34 | * @param Client $client |
||
35 | */ |
||
36 | public function __construct(Client $client) |
||
41 | |||
42 | /** |
||
43 | * @param array $options |
||
44 | * @return AdapterInterface |
||
45 | */ |
||
46 | public function setOptions(array $options = []): AdapterInterface |
||
54 | |||
55 | /** |
||
56 | * @param Client $client |
||
57 | * @param array $options |
||
58 | * @return array |
||
59 | */ |
||
60 | private function injectToken(Client $client, array $options) |
||
69 | |||
70 | /** |
||
71 | * @param Route $route |
||
72 | * @return array |
||
73 | * @throws \RuntimeException |
||
74 | * @throws \InvalidArgumentException |
||
75 | */ |
||
76 | public function request(Route $route): array |
||
92 | |||
93 | /** |
||
94 | * @param Route $route |
||
95 | * @return array |
||
96 | */ |
||
97 | private function prepareRequestOptions(Route $route): array |
||
107 | |||
108 | /** |
||
109 | * @param ResponseInterface $response |
||
110 | * @return array |
||
111 | * @throws \RuntimeException |
||
112 | */ |
||
113 | private function parseResponse(ResponseInterface $response): array |
||
123 | } |
||
124 |