1 | <?php |
||
11 | class Period implements PeriodInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var \DateTimeInterface |
||
15 | */ |
||
16 | private $start; |
||
17 | /** |
||
18 | * @var \DateTimeInterface |
||
19 | */ |
||
20 | private $end; |
||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | private $length; |
||
25 | |||
26 | /** |
||
27 | * Period constructor. |
||
28 | * @param \DateTimeInterface $start |
||
29 | * @param \DateTimeInterface $end |
||
30 | */ |
||
31 | 3 | public function __construct(\DateTimeInterface $start, \DateTimeInterface $end) |
|
37 | |||
38 | /** |
||
39 | * @return int |
||
40 | */ |
||
41 | 3 | public function getLength(): int |
|
45 | |||
46 | /** |
||
47 | * @return \DateTimeInterface |
||
48 | */ |
||
49 | 3 | public function getEnd(): \DateTimeInterface |
|
53 | |||
54 | 3 | public function getStart(): \DateTimeInterface |
|
55 | { |
||
56 | 3 | return $this->start; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param \DateTimeInterface $periodStart |
||
61 | * @param \DateTimeInterface $periodEnd |
||
62 | * @return int |
||
63 | */ |
||
64 | 3 | private static function calculatePeriodLength(\DateTimeInterface $periodStart, \DateTimeInterface $periodEnd): int |
|
69 | |||
70 | } |
||
71 |