1 | <?php |
||
21 | abstract class AbstractApiResponse implements ApiResponseInterface, ContextAwareInterface |
||
22 | { |
||
23 | use ContextTrait; |
||
24 | |||
25 | /** |
||
26 | * @var ResponseInterface|AdapterPromiseInterface |
||
27 | */ |
||
28 | protected $response; |
||
29 | |||
30 | /** |
||
31 | * @var ClientRequestInterface |
||
32 | */ |
||
33 | protected $request; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $jsonData; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $responseBody; |
||
44 | |||
45 | /** |
||
46 | * @var ErrorContainer |
||
47 | */ |
||
48 | private $errors; |
||
49 | |||
50 | /** |
||
51 | * @param ResponseInterface $response |
||
52 | * @param ClientRequestInterface $request |
||
53 | * @param Context $context |
||
54 | */ |
||
55 | 326 | public function __construct(ResponseInterface $response, ClientRequestInterface $request, Context $context = null) |
|
61 | |||
62 | /** |
||
63 | * @return mixed|null |
||
64 | */ |
||
65 | 75 | public function toObject() |
|
73 | |||
74 | /** |
||
75 | * @return array |
||
76 | */ |
||
77 | 280 | public function toArray() |
|
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | 283 | public function getBody() |
|
95 | |||
96 | /** |
||
97 | * @return bool |
||
98 | */ |
||
99 | 261 | public function isError() |
|
105 | |||
106 | 13 | protected function getResponseField($fieldName, $default = '') |
|
111 | |||
112 | /** |
||
113 | * @return array |
||
114 | */ |
||
115 | 13 | public function getErrors() |
|
122 | |||
123 | 263 | public function getStatusCode() |
|
127 | |||
128 | /** |
||
129 | * @param string $header |
||
130 | * @return array |
||
131 | */ |
||
132 | /** |
||
133 | * @param string $header |
||
134 | * @return string[] |
||
135 | */ |
||
136 | 1 | public function getHeader($header) |
|
140 | |||
141 | /** |
||
142 | * @return array |
||
143 | */ |
||
144 | 1 | public function getHeaders() |
|
148 | |||
149 | /** |
||
150 | * @return ResponseInterface|AdapterPromiseInterface |
||
151 | */ |
||
152 | 269 | public function getResponse() |
|
156 | |||
157 | /** |
||
158 | * @return ClientRequestInterface |
||
159 | */ |
||
160 | 75 | public function getRequest() |
|
164 | |||
165 | /** |
||
166 | * Returns the result of the future either from cache or by blocking until |
||
167 | * it is complete. |
||
168 | * |
||
169 | * This method must block until the future has a result or is cancelled. |
||
170 | * Throwing an exception in the wait() method will mark the future as |
||
171 | * realized and will throw the exception each time wait() is called. |
||
172 | * Throwing an instance of GuzzleHttp\Ring\CancelledException will mark |
||
173 | * the future as realized, will not throw immediately, but will throw the |
||
174 | * exception if the future's wait() method is called again. |
||
175 | * |
||
176 | * @return mixed |
||
177 | */ |
||
178 | 2 | public function wait() |
|
186 | |||
187 | /** |
||
188 | * @param callable $onFulfilled |
||
189 | * @param callable $onRejected |
||
190 | * @return ApiResponseInterface |
||
191 | */ |
||
192 | 4 | public function then(callable $onFulfilled = null, callable $onRejected = null) |
|
201 | } |
||
202 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..