1 | <?php |
||
20 | class DateTimeHelper implements DateTimeHelperInterface |
||
21 | { |
||
22 | private const INTERNAL_DATE_FORMAT = 'Y-m-d'; |
||
23 | |||
24 | /** @var mixed[] */ |
||
25 | private $datesCache = []; |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | public function createDateTimeZone(string $timeZoneName = 'UTC'): \DateTimeZone |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function getCurrentTimestamp(): int |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function getCurrentDatetime(?\DateTimeZone $timeZone = null): \DateTime |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function getCurrentDatetimeImmutable(?\DateTimeZone $timeZone = null): \DateTimeImmutable |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getDatesFromDateRangeAsArrayOfObjects(DateRangeInterface $dateRange): array |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function getDatesFromDateRangeAsArrayOfStrings(DateRangeInterface $dateRange): array |
||
99 | |||
100 | /** |
||
101 | * @param DateRangeInterface $dateRange |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | private function getCacheKeyForDateRange(DateRangeInterface $dateRange): string |
||
118 | } |
||
119 |