Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
31 | 48 | protected static function getTime(string|int|null $value): ?\DateTime |
|
32 | { |
||
33 | 48 | if ($value !== null) { |
|
34 | // Workaround for amazon developer console sending unix timestamp |
||
35 | try { |
||
36 | 48 | return new \DateTime((string) $value); |
|
37 | 14 | } catch (\Exception $e) { |
|
38 | 14 | return (new \DateTime())->setTimestamp((int) ((string) ($value / 1000))); |
|
39 | } |
||
40 | } |
||
41 | |||
42 | 6 | return null; |
|
43 | } |
||
45 |