PrivacyPolicy::getChangedAt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
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
}