Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | trait DateUpdatedAwareTrait |
||
12 | { |
||
13 | /** |
||
14 | * @var \DateTimeInterface|null |
||
15 | */ |
||
16 | protected ?\DateTimeInterface $dateUpdated; |
||
17 | |||
18 | /** |
||
19 | * Check if the updated date has been set. |
||
20 | * |
||
21 | * @return bool |
||
22 | */ |
||
23 | public function hasDateUpdated(): bool |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Return the updated date. |
||
30 | * |
||
31 | * @return \DateTimeInterface|null |
||
32 | */ |
||
33 | public function getDateUpdated(): ?\DateTime |
||
34 | { |
||
35 | return $this->dateUpdated; |
||
|
|||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Set the updated date. |
||
40 | * |
||
41 | * @param \DateTimeInterface|null $dateTime |
||
42 | */ |
||
43 | public function setDateUpdated(?\DateTimeInterface $dateTime): void |
||
46 | } |
||
47 | } |
||
48 |