PrivacyPolicy   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 33
ccs 0
cts 6
cp 0
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getContent() 0 2 1
A setContent() 0 3 1
A __construct() 0 2 1
A setChangedAt() 0 3 1
A getChangedAt() 0 2 1
1
<?php
2
3
namespace App\Entity;
4
5
use DateTime;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
use Ramsey\Uuid\Uuid;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11
#[ORM\Entity]
12
class PrivacyPolicy {
13
14
    use IdTrait;
15
    use UuidTrait;
16
17
    #[ORM\Column(type: 'text')]
18
    #[Assert\NotBlank]
19
    private ?string $content = null;
20
21
    #[ORM\Column(type: 'datetime')]
22
    #[Gedmo\Timestampable(on: 'create')]
23
    private ?DateTime $changedAt = null;
24
25
    public function __construct() {
26
        $this->uuid = Uuid::uuid4();
27
    }
28
29
    public function setChangedAt(DateTime $dateTime): PrivacyPolicy {
30
        $this->changedAt = $dateTime;
31
        return $this;
32
    }
33
34
    public function getChangedAt(): DateTime {
35
        return $this->changedAt;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->changedAt could return the type null which is incompatible with the type-hinted return DateTime. Consider adding an additional type-check to rule them out.
Loading history...
36
    }
37
    public function getContent(): ?string {
38
        return $this->content;
39
    }
40
41
    public function setContent(?string $content): PrivacyPolicy {
42
        $this->content = $content;
43
        return $this;
44
    }
45
}