Passed
Pull Request — master (#52)
by Vincent
11:12 queued 04:00
created

UploadableTrait::getFileName()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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\Entity\Utility;
15
16
use Silverback\ApiComponentBundle\Annotation as Silverback;
17
use Symfony\Component\HttpFoundation\File\UploadedFile;
18
19
/**
20
 * @author Vincent Chalamon <[email protected]>
21
 */
22
trait UploadableTrait
23
{
24
    private ?string $fileName = null;
25
26
    /**
27
     * @Silverback\UploadableField
28
     */
29
    private ?UploadedFile $file = null;
30
31
    public function getFileName(): ?string
32
    {
33
        return $this->fileName;
34
    }
35
36
    public function setFileName(?string $fileName): self
37
    {
38
        $this->fileName = $fileName;
39
40
        return $this;
41
    }
42
43
    public function getFile(): ?UploadedFile
44
    {
45
        return $this->file;
46
    }
47
48
    public function setFile(?UploadedFile $file): self
49
    {
50
        $this->file = $file;
51
52
        return $this;
53
    }
54
}
55