Completed
Pull Request — master (#2680)
by
unknown
22:28
created

ImageUploadModel::setFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kunstmaan\MediaBundle\Model;
6
7
use Symfony\Component\HttpFoundation\File\File;
8
use Symfony\Component\Validator\Constraints as Assert;
9
10
/** @internal  */
11
final class ImageUploadModel
12
{
13
    /**
14
     * @var File
15
     * @Assert\Image(detectCorrupted=true)
16
     */
17
    private $file;
18
19 1
    public function __construct(File $file)
20
    {
21 1
        $this->file = $file;
22 1
    }
23
24
    public function getFile(): ?File
25
    {
26
        return $this->file;
27
    }
28
29
    public function setFile(?File $file)
30
    {
31
        $this->file = $file;
32
33
        return $this;
34
    }
35
}
36