1 | <?php |
||
21 | abstract class AbstractApiResponse implements ApiResponseInterface, ContextAwareInterface |
||
22 | { |
||
23 | const X_CORRELATION_ID = 'X-Correlation-ID'; |
||
24 | use ContextTrait; |
||
25 | |||
26 | /** |
||
27 | * @var ResponseInterface|AdapterPromiseInterface |
||
28 | */ |
||
29 | protected $response; |
||
30 | |||
31 | /** |
||
32 | * @var ClientRequestInterface |
||
33 | */ |
||
34 | protected $request; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $jsonData; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $responseBody; |
||
45 | |||
46 | /** |
||
47 | * @var ErrorContainer |
||
48 | */ |
||
49 | private $errors; |
||
50 | |||
51 | /** |
||
52 | * @param ResponseInterface $response |
||
53 | * @param ClientRequestInterface $request |
||
54 | * @param Context $context |
||
55 | */ |
||
56 | 334 | public function __construct(ResponseInterface $response, ClientRequestInterface $request, Context $context = null) |
|
62 | |||
63 | /** |
||
64 | * @return mixed|null |
||
65 | */ |
||
66 | 75 | public function toObject() |
|
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | 284 | public function toArray() |
|
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | 287 | public function getBody() |
|
96 | |||
97 | /** |
||
98 | * @return bool |
||
99 | */ |
||
100 | 266 | public function isError() |
|
106 | |||
107 | 15 | protected function getResponseField($fieldName, $default = '') |
|
112 | |||
113 | /** |
||
114 | * @return array |
||
115 | */ |
||
116 | 15 | public function getErrors() |
|
123 | |||
124 | 1 | public function getCorrelationId() |
|
128 | |||
129 | 268 | public function getStatusCode() |
|
133 | |||
134 | /** |
||
135 | * @param string $header |
||
136 | * @return array |
||
137 | */ |
||
138 | /** |
||
139 | * @param string $header |
||
140 | * @return string[] |
||
141 | */ |
||
142 | 2 | public function getHeader($header) |
|
146 | |||
147 | /** |
||
148 | * @return array |
||
149 | */ |
||
150 | 1 | public function getHeaders() |
|
154 | |||
155 | /** |
||
156 | * @return ResponseInterface|AdapterPromiseInterface |
||
157 | */ |
||
158 | 275 | public function getResponse() |
|
162 | |||
163 | /** |
||
164 | * @return ClientRequestInterface |
||
165 | */ |
||
166 | 75 | public function getRequest() |
|
170 | |||
171 | /** |
||
172 | * Returns the result of the future either from cache or by blocking until |
||
173 | * it is complete. |
||
174 | * |
||
175 | * This method must block until the future has a result or is cancelled. |
||
176 | * Throwing an exception in the wait() method will mark the future as |
||
177 | * realized and will throw the exception each time wait() is called. |
||
178 | * Throwing an instance of GuzzleHttp\Ring\CancelledException will mark |
||
179 | * the future as realized, will not throw immediately, but will throw the |
||
180 | * exception if the future's wait() method is called again. |
||
181 | * |
||
182 | * @return mixed |
||
183 | */ |
||
184 | 2 | public function wait() |
|
192 | |||
193 | /** |
||
194 | * @param callable $onFulfilled |
||
195 | * @param callable $onRejected |
||
196 | * @return ApiResponseInterface |
||
197 | */ |
||
198 | 4 | public function then(callable $onFulfilled = null, callable $onRejected = null) |
|
207 | } |
||
208 |
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..