Media::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 2
c 1
b 0
f 0
nc 4
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 3
rs 10
1
<?php
2
3
namespace PiedWeb\CMSBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
7
use Vich\UploaderBundle\Mapping\Annotation as Vich;
8
9
/**
10
 * @ORM\MappedSuperclass
11
 * @Vich\Uploadable
12
 * @ORM\HasLifecycleCallbacks
13
 * UniqueEntity({"name"}, message="Ce nom existe déjà.")
14
 */
15
class Media implements MediaInterface
16
{
17
    use IdTrait;
18
    use MediaTrait;
0 ignored issues
show
Bug introduced by
The trait PiedWeb\CMSBundle\Entity\MediaTrait requires the property $previousMimeType which is not provided by PiedWeb\CMSBundle\Entity\Media.
Loading history...
19
20 3
    public function __construct()
21
    {
22 3
        $this->updatedAt = null !== $this->updatedAt ? $this->updatedAt : new \DateTime();
23 3
        $this->createdAt = null !== $this->createdAt ? $this->createdAt : new \DateTime();
24 3
    }
25
}
26