Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
18 | public function transform(float|int $value): DateTimeImmutable |
||
19 | { |
||
20 | $value = (int) floor(num: $value); |
||
21 | /** @noinspection SummerTimeUnsafeTimeManipulationInspection */ |
||
22 | $unix = ($value - 25569) * 86400; |
||
23 | $date = gmdate(format: self::DATETIME_FORMAT, timestamp: $unix); |
||
24 | |||
25 | return date_create_immutable_from_format(format: '!' . self::DATETIME_FORMAT, datetime: $date); |
||
26 | } |
||
28 |