1 | <?php |
||
10 | abstract class AbstractResponse implements ResponseInterface { |
||
11 | |||
12 | /** |
||
13 | * The Curl Request Resource that was used when curl_exec was called |
||
14 | * @var cURL resource handle |
||
15 | */ |
||
16 | protected $CurlRequest; |
||
17 | |||
18 | /** |
||
19 | * Extracted headers from Curl Response |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $headers; |
||
23 | |||
24 | /** |
||
25 | * Extracted body from Curl Response |
||
26 | * @var mixed |
||
27 | */ |
||
28 | protected $body; |
||
29 | |||
30 | /** |
||
31 | * The HTTP Status Code of Request |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $status; |
||
35 | |||
36 | /** |
||
37 | * The last Curl Error that occurred |
||
38 | * @var string|boolean - False when no Curl Error = 0 |
||
39 | */ |
||
40 | protected $error; |
||
41 | |||
42 | /** |
||
43 | * The cURL Resource information returned via curl_getinfo |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $info; |
||
47 | |||
48 | 1 | public function __construct($curlRequest,$curlResponse = NULL){ |
|
54 | |||
55 | 1 | public function setCurlResponse($curlResponse) { |
|
61 | |||
62 | /** |
||
63 | * Extract the information from the Curl Request via curl_getinfo |
||
64 | * Setup the Status property to be equal to the http_code |
||
65 | */ |
||
66 | 2 | protected function extractInfo(){ |
|
75 | |||
76 | /** |
||
77 | * Seperate the Headers and Body from the CurlResponse, and set the object properties |
||
78 | * @param string $curlResponse |
||
79 | */ |
||
80 | 1 | protected function extractResponse($curlResponse){ |
|
84 | |||
85 | /** |
||
86 | * @inheritdoc |
||
87 | */ |
||
88 | 1 | public function getStatus(){ |
|
91 | |||
92 | /** |
||
93 | * @inheritdoc |
||
94 | */ |
||
95 | 1 | public function getBody(){ |
|
98 | |||
99 | /** |
||
100 | * @inheritdoc |
||
101 | */ |
||
102 | 1 | public function getHeaders(){ |
|
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | 2 | public function getError(){ |
|
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | 1 | public function getInfo(){ |
|
119 | |||
120 | } |
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..