Test Failed
Push — master ( fb851e...88d50a )
by Daniel
05:40
created

FileData::getFileSize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Silverback\ApiComponentBundle\Dto\File;
6
7
use Symfony\Component\Serializer\Annotation\Groups;
8
9
/**
10
 * Class FileData
11
 * @package Silverback\ApiComponentBundle\Entity\Content
12
 * This class is to hold data about a file and is added into a File component during serialization
13
 */
14
class FileData
15
{
16
    /**
17
     * @Groups({"default"})
18
     * @var string|null
19
     */
20
    private $publicPath;
21
22
    /**
23
     * @Groups({"default"})
24
     * @var string|null
25
     */
26
    private $fileExtension;
27
28
    /**
29
     * @Groups({"default"})
30
     * @var int|null
31
     */
32
    private $fileSize;
33
34
    /**
35
     * @Groups({"default"})
36
     * @var ImageMetadata|null
37
     */
38
    private $imageData;
39
40
    /**
41
     * @Groups({"default"})
42
     * @var ImageMetadata[]|null
43
     */
44
    private $imagineData;
45
46
    public function __construct(
47
        ?string $publicPath,
48
        ?ImageMetadata $imageData,
49
        ?array $imagineData,
50
        ?string $fileExtension,
51
        ?int $fileSize
52
    )
53
    {
54
        $this->publicPath = $publicPath;
55
        $this->imageData = $imageData;
56
        $this->imagineData = $imagineData;
57
        $this->fileExtension = $fileExtension;
58
        $this->fileSize = $fileSize;
59
    }
60
61
    public function getPublicPath(): ?string
62
    {
63
        return $this->publicPath;
64
    }
65
66
    public function getImageData(): ?ImageMetadata
67
    {
68
        return $this->imageData;
69
    }
70
71
    public function getImagineData(): ?array
72
    {
73
        return $this->imagineData;
74
    }
75
76
    public function getFileExtension(): ?string
77
    {
78
        return $this->fileExtension;
79
    }
80
81
    public function getFileSize(): ?float
82
    {
83
        return $this->fileSize;
84
    }
85
}
86