From a3a7bb2ff92eb9bf3483a8b6954ad7adb3c1c623 Mon Sep 17 00:00:00 2001 From: David Olivier Date: Mon, 17 Jun 2024 01:58:46 +0200 Subject: [PATCH 1/2] Fix: Wrong type-hint function decodeResponse was expecting Response changed it to ResponseInterface Signed-off-by: David Olivier --- src/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api.php b/src/Api.php index 4a237ae..3c6170e 100644 --- a/src/Api.php +++ b/src/Api.php @@ -327,7 +327,7 @@ protected function rawCall($method, $path, $content = null, $is_authenticated = * * @throws \JsonException */ - private function decodeResponse(Response $response) + private function decodeResponse(ResponseInterface $response) { if ($response->getStatusCode() === 204 || $response->getBody()->getSize() === 0) { return null; From 43297a7ee1e73efa68fb7ef66f3bd8fdf6abce39 Mon Sep 17 00:00:00 2001 From: David Olivier Date: Mon, 17 Jun 2024 02:00:11 +0200 Subject: [PATCH 2/2] Add function setConsumerKey It allows to switch between consumer keys keeping the same object Signed-off-by: David Olivier --- src/Api.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Api.php b/src/Api.php index 3c6170e..32a9d57 100644 --- a/src/Api.php +++ b/src/Api.php @@ -419,6 +419,14 @@ public function getConsumerKey(): ?string return $this->consumer_key; } + /** + * Get the current consumer key + */ + public function setConsumerKey($consumer_key): void + { + $this->consumer_key = $consumer_key; + } + /** * Return instance of http client */