File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ abstract public function getHttpClient();
20
20
21
21
abstract public function handleEmptyResponse (?string $ content = null , ?\Psr \Http \Message \ResponseInterface $ response = null );
22
22
23
- abstract public function isErrorResponse (): bool ;
23
+ abstract public function isErrorResponse (array $ data ): bool ;
24
24
25
25
abstract public function handleErrorResponse (?string $ content = null , array $ data = []);
26
26
@@ -36,19 +36,19 @@ abstract public function getLastPage(): ?int;
36
36
37
37
abstract public function getDataList (): static |array |null ;
38
38
39
- public function castResponse (\ Psr \ Http \ Message \ ResponseInterface $ response )
39
+ public function castResponse ($ response )
40
40
{
41
- $ result = json_decode ($ content = $ response ->getBody ()->getContents (), true ) ?? [];
41
+ $ data = json_decode ($ content = $ response ->getBody ()->getContents (), true ) ?? [];
42
42
43
- if (empty ($ result )) {
43
+ if (empty ($ data )) {
44
44
$ this ->handleEmptyResponse ($ content , $ response );
45
45
}
46
46
47
- if ($ this ->isErrorResponse ()) {
48
- $ this ->handleErrorResponse ($ content , $ result );
47
+ if ($ this ->isErrorResponse ($ data )) {
48
+ $ this ->handleErrorResponse ($ content , $ data );
49
49
}
50
50
51
- return $ result ;
51
+ return $ data ;
52
52
}
53
53
54
54
public function paginate ()
You can’t perform that action at this time.
0 commit comments