| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 1 | public function writeResponse(ResponseInterface $response): ResponseInterface |
|
| 25 | { |
||
| 26 | 1 | if (array_key_exists('estimatedContentLength', $this->streamData)) { |
|
| 27 | 1 | $response = $response->withHeader( |
|
| 28 | 'Content-Length', |
||
| 29 | 1 | (string) $this->streamData['estimatedContentLength'], |
|
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $response |
||
| 34 | 1 | ->withBody($this->streamData['stream']) |
|
| 35 | 1 | ->withHeader('Content-Transfer-Encoding', 'binary') |
|
| 36 | 1 | ->withHeader('Cache-Control', 'no-cache') |
|
| 37 | 1 | ->withHeader('Content-Type', $this->streamData['contentType']); |
|
| 38 | } |
||
| 40 |