1 | <?php |
||
21 | class HttpAdapter extends AbstractClient implements SyncAdapterInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var Guzzle |
||
25 | */ |
||
26 | private $guzzle; |
||
27 | |||
28 | /** |
||
29 | * @var Client |
||
30 | */ |
||
31 | private $client; |
||
32 | |||
33 | /** |
||
34 | * HttpAdapter constructor. |
||
35 | * @param Client $client |
||
36 | * @throws \InvalidArgumentException |
||
37 | * @throws \RuntimeException |
||
38 | */ |
||
39 | public function __construct(Client $client) |
||
45 | |||
46 | /** |
||
47 | * @param Client $client |
||
48 | * @param array $options |
||
49 | * @return array |
||
50 | */ |
||
51 | private function injectToken(Client $client, array $options): array |
||
60 | |||
61 | /** |
||
62 | * @param Route $route |
||
63 | * @return array |
||
64 | * @throws \RuntimeException |
||
65 | * @throws \InvalidArgumentException |
||
66 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
67 | */ |
||
68 | public function request(Route $route): array |
||
89 | |||
90 | /** |
||
91 | * @param Route $route |
||
92 | * @return array |
||
93 | */ |
||
94 | private function prepareRequestOptions(Route $route): array |
||
104 | |||
105 | /** |
||
106 | * @param ResponseInterface $response |
||
107 | * @return array |
||
108 | * @throws \RuntimeException |
||
109 | */ |
||
110 | private function parseResponse(ResponseInterface $response): array |
||
120 | } |
||
121 |