From 2689559b05ced3d25252d55d4506436198d5fcd2 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Tue, 3 Dec 2024 13:58:19 +0100 Subject: [PATCH 1/2] fix: clone payload --- src/BEditaClient.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BEditaClient.php b/src/BEditaClient.php index 1b1d485..4aaeaaa 100644 --- a/src/BEditaClient.php +++ b/src/BEditaClient.php @@ -418,18 +418,18 @@ public function restoreObjects(array $ids, string $type = 'objects'): ?array * @param string $type Object type name * @param string $id Source object id * @param array $modified Object attributes to overwrite - * @param array $included Associations included: can be 'relationships' and 'translations' + * @param array $include Associations included: can be 'relationships' and 'translations' * @param array|null $headers Custom request headers * @return array|null Response in array format */ - public function clone(string $type, string $id, array $modified, array $included, ?array $headers = null): ?array + public function clone(string $type, string $id, array $modified, array $include, ?array $headers = null): ?array { $body = json_encode([ 'data' => [ 'type' => $type, 'attributes' => $modified, 'meta' => [ - 'included' => $included, + 'include' => $include, ], ], ]); From 22b26ceffffaa76218d077c4f144fd1455e9e046 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 30 Jan 2025 14:21:23 +0100 Subject: [PATCH 2/2] chore fix: cast var to string --- src/BaseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaseClient.php b/src/BaseClient.php index 1968602..19a0e1c 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -313,7 +313,7 @@ protected function sendRequest(string $method, string $path, ?array $query = nul $response = $this->getResponseBody(); // Message will be 'error` array, if absent use status massage $message = empty($response['error']) ? $this->getStatusMessage() : $response['error']; - throw new BEditaClientException($message, $this->getStatusCode()); + throw new BEditaClientException((string)$message, $this->getStatusCode()); } return $this->response;