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