Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
16 | 1 | private function generateImageResponse(string $imagePath): ResponseInterface |
|
17 | { |
||
18 | 1 | return $this->generateBinaryResponse($imagePath); |
|
19 | } |
||
20 | |||
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), |
|
30 |