1 | <?php |
||
21 | final class HTTPlugConnection extends AbstractConnection |
||
22 | { |
||
23 | /** |
||
24 | * @var HttpClient |
||
25 | */ |
||
26 | private $client; |
||
27 | |||
28 | /** |
||
29 | * @var MessageFactory |
||
30 | */ |
||
31 | private $messageFactory; |
||
32 | |||
33 | /** |
||
34 | * Initialize client. |
||
35 | * |
||
36 | * @param HttpClient $client |
||
37 | * @param MessageFactory $messageFactory |
||
38 | * @param string $apiKey |
||
39 | * @param string $uri |
||
40 | */ |
||
41 | public function __construct(HttpClient $client, MessageFactory $messageFactory, string $apiKey, string $uri = null) |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function call(string $method, array $params = [], string $requestMethod = 'GET'): array |
||
82 | |||
83 | /** |
||
84 | * @param ResponseInterface $response |
||
85 | * |
||
86 | * @throws ApiException |
||
87 | * @throws NotFoundException |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | private function parseResponse(ResponseInterface $response): array |
||
110 | |||
111 | /** |
||
112 | * Builds request parameter. |
||
113 | * |
||
114 | * @param array $parameter |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | private function buildParameter(array $parameter): string |
||
122 | } |
||
123 |