Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 63.64% |
Changes | 0 |
1 | <?php |
||
22 | trait TimestampedTrait |
||
23 | { |
||
24 | private ?DateTimeImmutable $createdAt = null; |
||
25 | |||
26 | public ?DateTime $modifiedAt = null; |
||
27 | |||
28 | /** @return static */ |
||
29 | 7 | public function setCreatedAt(DateTimeImmutable $createdAt) |
|
30 | { |
||
31 | 7 | if (!$this->createdAt) { |
|
32 | 7 | $this->createdAt = $createdAt; |
|
33 | } |
||
34 | |||
35 | 7 | return $this; |
|
36 | } |
||
37 | |||
38 | public function getCreatedAt(): ?DateTimeImmutable |
||
39 | { |
||
40 | return $this->createdAt; |
||
41 | } |
||
42 | |||
43 | /** @return static */ |
||
44 | 7 | public function setModifiedAt(DateTime $modifiedAt) |
|
45 | { |
||
46 | 7 | $this->modifiedAt = $modifiedAt; |
|
47 | |||
48 | 7 | return $this; |
|
49 | } |
||
50 | |||
51 | public function getModifiedAt(): ?DateTime |
||
54 | } |
||
55 | } |
||
56 |