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