File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 11<?php
22
3- /*
4- * Fresns (https://fresns.org)
5- * Copyright (C) 2021-Present Jarvis Tang
6- */
7-
83namespace Plugins \FresnsEngine ;
94
105trait Clientable
@@ -41,9 +36,9 @@ abstract public function getLastPage(): ?int;
4136
4237 abstract public function getDataList (): static |array |null ;
4338
44- public function castResponse ()
39+ public function castResponse ($ response )
4540 {
46- $ result = json_decode ($ content = $ this -> response ->getBody ()->getContents (), true ) ?? [];
41+ $ result = json_decode ($ content = $ response ->getBody ()->getContents (), true ) ?? [];
4742
4843 if (empty ($ result )) {
4944 $ this ->handleEmptyResponse ($ content );
@@ -81,7 +76,7 @@ public function __call($method, $args)
8176 {
8277 $ this ->response = $ this ->getHttpClient ()->$ method (...$ args );
8378
84- $ this ->result = $ this ->castResponse ();
79+ $ this ->result = $ this ->castResponse ($ this -> response );
8580
8681 $ this ->attributes = $ this ->result ;
8782
You can’t perform that action at this time.
0 commit comments