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