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 | /** @var \DateTimeZone|null */ |
||
28 | private $timeZoneUtc; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function createDateTimeZone(string $timeZoneName = 'UTC'): \DateTimeZone |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function createDateTimeZoneUtc(): \DateTimeZone |
||
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | public function getCurrentTimestamp(): int |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function getCurrentDatetime(?\DateTimeZone $timeZone = null): \DateTime |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getCurrentDatetimeUtc(): \DateTime |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function getCurrentDatetimeImmutable(?\DateTimeZone $timeZone = null): \DateTimeImmutable |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function getCurrentDatetimeImmutableUtc(): \DateTimeImmutable |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function getDatesFromDateRangeAsArrayOfObjects(DateRangeInterface $dateRange): array |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function getDatesFromDateRangeAsArrayOfStrings(DateRangeInterface $dateRange): array |
||
130 | |||
131 | /** |
||
132 | * @param DateRangeInterface $dateRange |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | private function getCacheKeyForDateRange(DateRangeInterface $dateRange): string |
||
149 | } |
||
150 |