1 | <?php |
||
17 | final class ApiClient implements ApiClientInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var ConnectionInterface |
||
21 | */ |
||
22 | private $connection; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $apiKey; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $sharedSecret; |
||
33 | |||
34 | /** |
||
35 | * @param ConnectionInterface $connection |
||
36 | * @param string $apiKey |
||
37 | * @param string $sharedSecret |
||
38 | */ |
||
39 | public function __construct(ConnectionInterface $connection, string $apiKey, string $sharedSecret) |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function getApiKey(): string |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function getSharedSecret(): string |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function signedCall(string $method, array $params = [], SessionInterface $session = null, $requestMethod = 'GET'): array |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function unsignedCall(string $method, array $params = [], string $requestMethod = 'GET'): array |
||
105 | |||
106 | /** |
||
107 | * Filter null values. |
||
108 | * |
||
109 | * @param array $object |
||
110 | * |
||
111 | * @return array |
||
112 | */ |
||
113 | private function filterNull(array $object): array |
||
119 | |||
120 | /** |
||
121 | * Converts any string or array of strings to UTF8. |
||
122 | * |
||
123 | * @param mixed|mixed[] $object a String or an array |
||
124 | * |
||
125 | * @return mixed|mixed[] UTF8-string or array |
||
126 | */ |
||
127 | private function encodeUTF8($object) |
||
135 | |||
136 | /** |
||
137 | * @param array $params |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | private function signParams(array $params): string |
||
153 | |||
154 | /** |
||
155 | * @param string $method |
||
156 | * @param array $params |
||
157 | * |
||
158 | * @return array |
||
159 | */ |
||
160 | private function call(string $method, array $params): array |
||
172 | } |
||
173 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.