1 | <?php |
||
8 | class Response |
||
9 | { |
||
10 | /** |
||
11 | * @var \Postpay\Http\Request The original request. |
||
12 | */ |
||
13 | protected $request; |
||
14 | |||
15 | /** |
||
16 | * @var int The HTTP response status code. |
||
17 | */ |
||
18 | protected $statusCode; |
||
19 | |||
20 | /** |
||
21 | * @var array The headers returned from API. |
||
22 | */ |
||
23 | protected $headers; |
||
24 | |||
25 | /** |
||
26 | * @var string The raw body of the response. |
||
27 | */ |
||
28 | protected $body; |
||
29 | |||
30 | /** |
||
31 | * @var array The decoded body. |
||
32 | */ |
||
33 | protected $decodedBody = []; |
||
34 | |||
35 | /** |
||
36 | * @var string The exception type to be thrown. |
||
37 | */ |
||
38 | protected $exc; |
||
39 | |||
40 | /** |
||
41 | * @var \Postpay\Exceptions\PostpayException The exception thrown. |
||
42 | */ |
||
43 | protected $thrownException; |
||
44 | |||
45 | /** |
||
46 | * Creates a new Response entity. |
||
47 | * |
||
48 | * @param \Postpay\Http\Request $request |
||
49 | * @param int|null $statusCode |
||
50 | * @param array|null $headers |
||
51 | * @param string|null $body |
||
52 | */ |
||
53 | 21 | public function __construct( |
|
71 | |||
72 | /** |
||
73 | * Return the original request that returned this response. |
||
74 | * |
||
75 | * @return \Postpay\Http\Request |
||
76 | */ |
||
77 | 7 | public function getRequest() |
|
81 | |||
82 | /** |
||
83 | * Return the HTTP status code. |
||
84 | * |
||
85 | * @return int |
||
86 | */ |
||
87 | 5 | public function getStatusCode() |
|
91 | |||
92 | /** |
||
93 | * Return the HTTP headers. |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | 1 | public function getHeaders() |
|
101 | |||
102 | /** |
||
103 | * Return the JSON response. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | 7 | public function json() |
|
111 | |||
112 | /** |
||
113 | * Returns true if API returned an error message. |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | 21 | public function isError() |
|
125 | |||
126 | /** |
||
127 | * Convert the raw response into an array if possible. |
||
128 | */ |
||
129 | 21 | public function decodeBody() |
|
141 | |||
142 | /** |
||
143 | * Returns the exception that was thrown. |
||
144 | * |
||
145 | * @return \Postpay\Exceptions\ApiException|null |
||
146 | */ |
||
147 | 2 | public function getThrownException() |
|
151 | } |
||
152 |
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..