1 | <?php |
||
16 | class AnalyticsResponse implements AnalyticsResponseInterface |
||
17 | { |
||
18 | /** |
||
19 | * HTTP status code for the response. |
||
20 | * |
||
21 | * @var null|int |
||
22 | */ |
||
23 | protected $httpStatusCode; |
||
24 | |||
25 | /** |
||
26 | * Request URI that was used to send the hit. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $requestUrl; |
||
31 | |||
32 | /** |
||
33 | * Response body. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $responseBody; |
||
38 | |||
39 | /** |
||
40 | * Gets the relevant data from the Guzzle clients. |
||
41 | * |
||
42 | * @param RequestInterface $request |
||
43 | * @param ResponseInterface|PromiseInterface $response |
||
44 | */ |
||
45 | public function __construct(RequestInterface $request, $response) |
||
61 | |||
62 | /** |
||
63 | * Gets the HTTP status code. |
||
64 | * It return NULL if the request was asynchronous since we are not waiting for the response. |
||
65 | * |
||
66 | * @api |
||
67 | * @return null|int |
||
68 | */ |
||
69 | public function getHttpStatusCode() |
||
73 | |||
74 | /** |
||
75 | * Gets the request URI used to get the response. |
||
76 | * |
||
77 | * @api |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getRequestUrl() |
||
84 | |||
85 | /** |
||
86 | * Gets the debug response. Returns empty array if no response found. |
||
87 | * |
||
88 | * @api |
||
89 | * @return array |
||
90 | */ |
||
91 | public function getDebugResponse() |
||
102 | } |
||
103 |