1 | <?php |
||
15 | class Response implements ResponseInterface |
||
16 | { |
||
17 | private $httpVersion; |
||
18 | private $httpCode; |
||
19 | private $httpCodeString; |
||
20 | private $response; |
||
21 | private $info; |
||
22 | private $errno; |
||
23 | private $errorString; |
||
24 | private $headers = array(); |
||
25 | private $body; |
||
26 | |||
27 | 19 | public function __construct($response, array $info, $errno, $errorString) |
|
39 | |||
40 | 19 | private function buildHeaderParts($response) |
|
47 | |||
48 | 19 | private function buildHeadersArray($headers) |
|
49 | { |
||
50 | 19 | $headers = explode("\n", $headers); |
|
51 | 19 | $httHead = array_shift($headers); |
|
52 | 19 | list($this->httpVersion, $this->httpCode, $this->httpCodeString) = explode(" ", $httHead, 3); |
|
53 | |||
54 | 19 | foreach ($headers as $header) { |
|
55 | 19 | list($key, $value) = explode(": ", $header, 2); |
|
56 | 19 | $this->headers[trim($key)] = trim($value); |
|
57 | 19 | } |
|
58 | 19 | } |
|
59 | |||
60 | 1 | public function getHeaders() |
|
64 | |||
65 | 9 | public function hasHeader($header) |
|
69 | |||
70 | 8 | public function getHeader($header) |
|
74 | |||
75 | 9 | public function bodyRaw() |
|
79 | |||
80 | 5 | public function bodyObject() |
|
89 | |||
90 | 2 | public function bodyArray() |
|
96 | |||
97 | 1 | public function getHttpVersion() |
|
101 | |||
102 | 1 | public function getHttpCode() |
|
106 | |||
107 | 1 | public function getInfo() |
|
111 | |||
112 | public function getErrorNo() |
||
116 | |||
117 | public function getErrorString() |
||
121 | |||
122 | public function getRaw() |
||
126 | |||
127 | public function getHttpCodeString() |
||
131 | } |
||
132 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: