Skip to content

Commit 078842e

Browse files
authored
Update Clientable.php
1 parent 3b2ea65 commit 078842e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Traits/Clientable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public static function make()
1818

1919
abstract public function getHttpClient();
2020

21-
abstract public function handleEmptyResponse(?string $content = null);
21+
abstract public function handleEmptyResponse(?string $content = null, $response = null);
2222

2323
abstract public function isErrorResponse(): bool;
2424

25-
abstract public function handleErrorResponse(?string $content = null);
25+
abstract public function handleErrorResponse(?string $content = null, array $data = []);
2626

2727
abstract public function hasPaginate(): bool;
2828

@@ -41,11 +41,11 @@ public function castResponse($response)
4141
$result = json_decode($content = $response->getBody()->getContents(), true) ?? [];
4242

4343
if (empty($result)) {
44-
$this->handleEmptyResponse($content);
44+
$this->handleEmptyResponse($content, $response);
4545
}
4646

4747
if ($this->isErrorResponse()) {
48-
$this->handleErrorResponse($content);
48+
$this->handleErrorResponse($content, $result);
4949
}
5050

5151
return $result;

0 commit comments

Comments
 (0)