| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | public function handleResponse(ResponseInterface $response){ |
||
| 40 | $data = new stdClass; |
||
| 41 | $data->errorcode = $response->error->code; |
||
|
|
|||
| 42 | $data->statuscode = $response->info->http_code; |
||
| 43 | $data->content_length_header = $response->headers->{'content-length'}; |
||
| 44 | $data->content_length_body = $response->body->length; |
||
| 45 | $data->content_type = $response->body->content_type; |
||
| 46 | $data->ids = array_column($response->json, 'id'); |
||
| 47 | |||
| 48 | sort($data->ids); |
||
| 49 | |||
| 50 | $this->request->addResponse($data); |
||
| 51 | } |
||
| 52 | |||
| 54 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: