Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
21 | 1 | private function generateBinaryResponse(string $path, array $extraHeaders = []): ResponseInterface |
|
22 | { |
||
23 | 1 | $body = new Stream($path); |
|
24 | 1 | return new Response($body, StatusCode::STATUS_OK, ArrayUtils::merge([ |
|
25 | 1 | 'Content-Type' => (new finfo(FILEINFO_MIME))->file($path), |
|
26 | 1 | 'Content-Length' => (string) $body->getSize(), |
|
27 | 1 | ], $extraHeaders)); |
|
28 | } |
||
30 |