Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
27 | 1 | protected function generateBinaryResponse($path, $extraHeaders = []) |
|
28 | { |
||
29 | 1 | $body = new Stream($path); |
|
30 | 1 | return new Response($body, 200, ArrayUtils::merge([ |
|
31 | 1 | 'Content-Type' => (new \finfo(FILEINFO_MIME))->file($path), |
|
32 | 1 | 'Content-Length' => (string) $body->getSize(), |
|
33 | 1 | ], $extraHeaders)); |
|
34 | } |
||
35 | } |
||
36 |