Test Failed
Push — develop ( f6d190...8ff4ed )
by Daniel
04:04
created

FileData   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getImageData() 0 3 1
A __construct() 0 5 1
A getPublicPath() 0 3 1
A getImagineData() 0 3 1
1
<?php
2
3
namespace Silverback\ApiComponentBundle\DTO\File;
4
5
use Silverback\ApiComponentBundle\DTO\File\ImageMetadata;
6
use Symfony\Component\Serializer\Annotation\Groups;
7
8
/**
9
 * Class FileData
10
 * @package Silverback\ApiComponentBundle\Entity\Content
11
 * This class is to hold data about a file and is added into a File component during serialization
12
 */
13
class FileData
14
{
15
    /**
16
     * @Groups({"component", "content"})
17
     * @var string|null
18
     */
19
    private $publicPath;
20
21
    /**
22
     * @Groups({"component", "content"})
23
     * @var \Silverback\ApiComponentBundle\DTO\File\ImageMetadata|null
24
     */
25
    private $imageData;
26
27
    /**
28
     * @Groups({"component", "content"})
29
     * @var \Silverback\ApiComponentBundle\DTO\File\ImageMetadata[]|null
30
     */
31
    private $imagineData;
32
33
    /**
34
     * FileData constructor.
35
     * @param null|string $publicPath
36
     * @param null|\Silverback\ApiComponentBundle\DTO\File\ImageMetadata $imageData
37
     * @param null|\Silverback\ApiComponentBundle\DTO\File\ImageMetadata[] $imagineData
38
     */
39
    public function __construct(?string $publicPath, ?ImageMetadata $imageData, ?array $imagineData)
40
    {
41
        $this->publicPath = $publicPath;
42
        $this->imageData = $imageData;
43
        $this->imagineData = $imagineData;
44
    }
45
46
    /**
47
     * @return null|string
48
     */
49
    public function getPublicPath(): ?string
50
    {
51
        return $this->publicPath;
52
    }
53
54
    /**
55
     * @return null|\Silverback\ApiComponentBundle\DTO\File\ImageMetadata
56
     */
57
    public function getImageData(): ?ImageMetadata
58
    {
59
        return $this->imageData;
60
    }
61
62
    /**
63
     * @return null|\Silverback\ApiComponentBundle\DTO\File\ImageMetadata[]
64
     */
65
    public function getImagineData(): ?array
66
    {
67
        return $this->imagineData;
68
    }
69
}
70