Passed
Push — v2 ( c484e3...f03721 )
by Daniel
04:34
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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Component Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentBundle\Dto\File;
15
16
use ApiPlatform\Core\Annotation\ApiProperty;
17
18
/**
19
 * @author Daniel West <[email protected]>
20
 */
21
final class FileData
22
{
23
    /**
24
     * @ApiProperty(iri="http://schema.org/contentUrl", readable=false)
25
     */
26
    private ?string $url;
27
    private ?string $fileExtension;
28
    private ?int $fileSize;
29
    private ?ImageMetadata $imageData;
30
    private ?ImagineMetadata $imagineData;
31
32
    public function __construct(
33
        ?string $url,
34
        ?string $fileExtension,
35
        ?int $fileSize,
36
        ?ImageMetadata $imageData,
37
        ?ImagineMetadata $imagineData
38
    ) {
39
        $this->url = $url;
40
        $this->fileExtension = $fileExtension;
41
        $this->fileSize = $fileSize;
42
        $this->imageData = $imageData;
43
        $this->imagineData = $imagineData;
44
    }
45
46
    public function getUrl(): ?string
47
    {
48
        return $this->url;
49
    }
50
51
    public function getImageData(): ?ImageMetadata
52
    {
53
        return $this->imageData;
54
    }
55
56
    public function getImagineData(): ?ImagineMetadata
57
    {
58
        return $this->imagineData;
59
    }
60
61
    public function getFileExtension(): ?string
62
    {
63
        return $this->fileExtension;
64
    }
65
66
    public function getFileSize(): ?float
67
    {
68
        return $this->fileSize;
69
    }
70
}
71