Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class DateField extends AbstractField |
||
8 | { |
||
9 | private $dateTime; |
||
10 | |||
11 | 8 | public function __construct(string $name, \DateTimeInterface $date) |
|
12 | { |
||
13 | 8 | parent::__construct($name, null); |
|
14 | |||
15 | 8 | $this->setDateTime($date); |
|
16 | 8 | } |
|
17 | |||
18 | 6 | public function getDateTime(): \DateTimeImmutable |
|
19 | { |
||
20 | 6 | return $this->dateTime; |
|
1 ignored issue
–
show
|
|||
21 | } |
||
22 | |||
23 | /** |
||
24 | * If a DateTime instance is provided, it is converted to DateTimeImmutable. |
||
25 | */ |
||
26 | 8 | public function setDateTime(\DateTimeInterface $dateTime): void |
|
33 | 8 | } |
|
34 | } |
||
35 |