1 | <?php |
||
17 | final class HTTPlugConnection extends AbstractConnection |
||
18 | { |
||
19 | /** |
||
20 | * @var HttpClient |
||
21 | */ |
||
22 | private $client; |
||
23 | |||
24 | /** |
||
25 | * @var MessageFactory |
||
26 | */ |
||
27 | private $messageFactory; |
||
28 | |||
29 | /** |
||
30 | * Initialize client. |
||
31 | * |
||
32 | * @param HttpClient $client |
||
33 | * @param MessageFactory $messageFactory |
||
34 | * @param string $apikey |
||
35 | * @param string $sharedSecret |
||
36 | * @param string $uri |
||
37 | */ |
||
38 | public function __construct(HttpClient $client, MessageFactory $messageFactory, string $apikey, string $sharedSecret, string $uri = null) |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function getPageBody(string $url): ? string |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | protected function call(array $params, string $requestMethod = 'GET') : array |
||
81 | |||
82 | /** |
||
83 | * @param ResponseInterface $response |
||
84 | * |
||
85 | * @return array |
||
86 | * |
||
87 | * @throws ApiException |
||
88 | */ |
||
89 | private function parseResponse(ResponseInterface $response): array |
||
99 | |||
100 | /** |
||
101 | * Builds request parameter. |
||
102 | * |
||
103 | * @param array $parameter |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | private function buildParameter(array $parameter): string |
||
111 | } |
||
112 |