Conditions | 4 |
Paths | 8 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function makeResponse(ResponseInterface $response) : void |
||
35 | { |
||
36 | $lines[] = sprintf( |
||
37 | 'HTTP/%s %d %s', |
||
38 | $response->getProtocolVersion(), |
||
39 | $response->getStatusCode(), |
||
40 | $response->getReasonPhrase() |
||
41 | ); |
||
42 | |||
43 | if (!$response->hasHeader(self::LENGTH)) { |
||
44 | $response->withHeader(self::LENGTH, $response->getBody()->getSize()); |
||
45 | } |
||
46 | |||
47 | foreach ($response->getHeaders() as $name => $values) { |
||
48 | $lines[] = sprintf('%s: %s', $name, implode(',', $values)); |
||
49 | } |
||
50 | |||
51 | $this->socket->write(implode(Protocol::CRLF, $lines).Protocol::SPLIT); |
||
52 | |||
53 | if ($response->getBody()->getSize() > 0) { |
||
54 | $this->socket->write((string)$response->getBody()); |
||
55 | } |
||
58 |
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..