1 | <?php |
||
22 | final class DateRange implements DateRangeInterface |
||
23 | { |
||
24 | private const INTERNAL_DATE_FORMAT = 'Y-m-d'; |
||
25 | |||
26 | /** @var \DateTimeImmutable */ |
||
27 | private $since; |
||
28 | |||
29 | /** @var \DateTimeImmutable */ |
||
30 | private $till; |
||
31 | |||
32 | /** |
||
33 | * @param \DateTimeInterface $since |
||
34 | * @param \DateTimeInterface $till |
||
35 | */ |
||
36 | public function __construct(\DateTimeInterface $since, \DateTimeInterface $till) |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function getSince(): \DateTimeImmutable |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function getTill(): \DateTimeImmutable |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function isEqual(DateRangeInterface $dateRange): bool |
||
71 | |||
72 | /** |
||
73 | * @param \DateTimeInterface $since |
||
74 | * @param \DateTimeInterface $till |
||
75 | * |
||
76 | * @throws LogicException |
||
77 | */ |
||
78 | private function assertSameTimezones(\DateTimeInterface $since, \DateTimeInterface $till): void |
||
84 | } |
||
85 |