FileResponse::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 3
nc 2
nop 2
crap 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 1
    public function __construct(string $filePath, int $httpCode = null)
18
    {
19 1
        $this->httpCode = $httpCode ?: Response::HTTP_OK;
20 1
        $this->filePath = $filePath;
21 1
    }
22
23 1
    public function getFile()
24
    {
25 1
        return $this->filePath;
26
    }
27
}
28