Passed
Pull Request — master (#50)
by Daniel
07:30
created

MediaObject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 1
f 0
dl 0
loc 19
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
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\Uploadable;
15
16
use ApiPlatform\Core\Annotation\ApiResource;
17
use Doctrine\ORM\Mapping as ORM;
18
use Silverback\ApiComponentBundle\Annotation as Silverback;
19
use Silverback\ApiComponentBundle\Entity\Utility\IdTrait;
20
use Silverback\ApiComponentBundle\Entity\Utility\TimestampedTrait;
21
use Silverback\ApiComponentBundle\Model\Uploadable\FileData;
22
use Symfony\Component\HttpFoundation\File\File;
23
use Symfony\Component\Validator\Constraints as Assert;
24
25
/**
26
 * @author Daniel West <[email protected]>
27
 *
28
 * @Silverback\MediaObject
29
 * @Silverback\Timestamped
30
 * @ApiResource
31
 * @ORM\Entity
32
 */
33
class MediaObject
34
{
35
    use IdTrait;
36
    use TimestampedTrait;
37
38
    /**
39
     * @Assert\NotNull(groups={"MediaObject:write"})
40
     */
41
    public File $file;
42
43
    public string $filePath;
44
45
    public bool $temporary = true;
46
47
    public FileData $fileData;
48
49
    public function __construct()
50
    {
51
        $this->setId();
52
    }
53
}
54