1 | <?php |
||
11 | abstract class Client implements LoggerAwareInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $apiUrl; |
||
17 | |||
18 | /** |
||
19 | * The client API key. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $apiKey; |
||
24 | |||
25 | /** |
||
26 | * @var ClientInterface |
||
27 | */ |
||
28 | private $httpClient; |
||
29 | |||
30 | /** |
||
31 | * @var DecoderInterface |
||
32 | */ |
||
33 | private $decoder; |
||
34 | |||
35 | /** |
||
36 | * @var LoggerInterface |
||
37 | */ |
||
38 | private $logger; |
||
39 | |||
40 | /** |
||
41 | * @param ClientInterface $httpClient |
||
42 | * @param DecoderInterface $decoder |
||
43 | * @param string $apiKey |
||
44 | */ |
||
45 | public function __construct(ClientInterface $httpClient, DecoderInterface $decoder, $apiKey) |
||
51 | |||
52 | /** |
||
53 | * @param string $method |
||
54 | * @param string $uri |
||
55 | * @param array $parameters |
||
56 | * @param array $options |
||
57 | * |
||
58 | * @return array |
||
59 | * |
||
60 | * @throws ClientErrorException |
||
61 | */ |
||
62 | public function request($method, $uri, array $parameters = [], array $options = []) |
||
87 | |||
88 | /** |
||
89 | * @param string $method |
||
90 | * @param string $uri |
||
91 | * @param array $options |
||
92 | */ |
||
93 | private function log($method, $uri, array $options = []) |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function setLogger(LoggerInterface $logger) |
||
122 | } |
||
123 |