Test Failed
Push — master ( 9e6cf9...d006e3 )
by Petr
04:08
created

FileResponse::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
3
namespace AppBundle\Response;
4
5
use AppBundle\Response\Infrastructure\AbstractApiResponse;
6
use Symfony\Component\HttpFoundation\Response;
7
8
/**
9
 * @author Vehsamrak
10
 */
11
class FileResponse extends AbstractApiResponse
12
{
13
14
    /** @var string */
15
    private $filePath;
16
17
    public function __construct(string $filePath, int $httpCode = null)
18
    {
19
        $this->httpCode = $httpCode ?: Response::HTTP_OK;
20
        $this->filePath = $filePath;
21
    }
22
23
    public function getFile()
24
    {
25
        return $this->filePath;
26
    }
27
}
28