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 | public function __construct(ConnectionInterface $connection, string $apiKey, string $sharedSecret) |
||
40 | |||
41 | public function getApiKey(): string |
||
45 | |||
46 | public function getSharedSecret(): string |
||
50 | |||
51 | public function signedCall(string $method, array $params = [], SessionInterface $session = null, $requestMethod = 'GET'): array |
||
73 | |||
74 | public function unsignedCall(string $method, array $params = [], string $requestMethod = 'GET'): array |
||
88 | |||
89 | /** |
||
90 | * Filter null values. |
||
91 | */ |
||
92 | private function filterNull(array $object): array |
||
98 | |||
99 | /** |
||
100 | * Converts any string or array of strings to UTF8. |
||
101 | * |
||
102 | * @param mixed|mixed[] $object a String or an array |
||
103 | * |
||
104 | * @return mixed|mixed[] UTF8-string or array |
||
105 | */ |
||
106 | private function encodeUTF8($object) |
||
114 | |||
115 | private function signParams(array $params): string |
||
127 | |||
128 | private function call(string $method, array $params): array |
||
140 | } |
||
141 |
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.