1 | <?php |
||
10 | class Response |
||
11 | { |
||
12 | /** @var string|null API path from the most recent request */ |
||
13 | private $apiPath; |
||
14 | /** @var int HTTP status code from the most recent request */ |
||
15 | private $httpCode = 0; |
||
16 | /** @var array HTTP headers from the most recent request */ |
||
17 | private $headers = []; |
||
18 | /** @var array|object Response body from the most recent request */ |
||
19 | private $body = []; |
||
20 | /** @var array HTTP headers from the most recent request that start with X */ |
||
21 | private $xHeaders = []; |
||
22 | |||
23 | /** |
||
24 | * @param string $apiPath |
||
25 | */ |
||
26 | public function setApiPath($apiPath) |
||
30 | |||
31 | /** |
||
32 | * @return string|null |
||
33 | */ |
||
34 | public function getApiPath() |
||
38 | |||
39 | /** |
||
40 | * @param array|object $body |
||
41 | */ |
||
42 | public function setBody($body) |
||
46 | |||
47 | /** |
||
48 | * @return array|object|string |
||
49 | */ |
||
50 | public function getBody() |
||
54 | |||
55 | /** |
||
56 | * @param int $httpCode |
||
57 | */ |
||
58 | public function setHttpCode($httpCode) |
||
62 | |||
63 | /** |
||
64 | * @return int |
||
65 | */ |
||
66 | public function getHttpCode() |
||
70 | |||
71 | /** |
||
72 | * @param array $headers |
||
73 | */ |
||
74 | public function setHeaders(array $headers) |
||
83 | |||
84 | /** |
||
85 | * @return array |
||
86 | */ |
||
87 | public function getsHeaders() |
||
91 | |||
92 | /** |
||
93 | * @param array $xHeaders |
||
94 | */ |
||
95 | public function setXHeaders(array $xHeaders = []) |
||
99 | |||
100 | /** |
||
101 | * @return array |
||
102 | */ |
||
103 | public function getXHeaders() |
||
107 | } |
||
108 |