1 | <?php |
||
5 | class ConsoleResponse |
||
6 | { |
||
7 | private $postFields; |
||
8 | |||
9 | private $getFields; |
||
10 | |||
11 | private $url; |
||
12 | |||
13 | private $method; |
||
14 | |||
15 | private $headers; |
||
16 | |||
17 | private $responseCode; |
||
18 | |||
19 | private $responseBody; |
||
20 | |||
21 | private $responseTime; |
||
22 | |||
23 | private $isError = false; |
||
24 | |||
25 | private $errorNumber; |
||
26 | |||
27 | private $errorMessage; |
||
28 | |||
29 | public function __construct($url, $method, $postFields, $getFields, $headers) |
||
37 | |||
38 | public function logRequest($responseCode, $responseBody, $responseTime) |
||
44 | |||
45 | public function logError($errorNumber, $errorMessage, $responseTime) |
||
52 | |||
53 | public function getPostFields() |
||
57 | |||
58 | public function getGetFields() |
||
62 | |||
63 | public function getUrl() |
||
67 | |||
68 | public function getMethod() |
||
72 | |||
73 | public function getHeaders() |
||
77 | |||
78 | public function isError() |
||
82 | |||
83 | /** |
||
84 | * @return integer |
||
85 | */ |
||
86 | public function getResponseCode() |
||
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getResponseBody() |
||
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getFormattedJsonBody() |
||
111 | |||
112 | /** |
||
113 | * @return integer |
||
114 | */ |
||
115 | public function getResponseTime() |
||
119 | |||
120 | /** |
||
121 | * @return integer |
||
122 | */ |
||
123 | public function getErrorNumber() |
||
127 | |||
128 | /** |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getErrorMessage() |
||
135 | } |
||
136 |