Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | 3 | public function getCreatedDateTime(string $timezone = 'America/New_York'): ?DateTime |
|
14 | { |
||
15 | 3 | if (!isset($this->extraArgs()['CreatedDateTime'])) { |
|
16 | 2 | return null; |
|
17 | } |
||
18 | |||
19 | try { |
||
20 | 2 | $createdDateTime = new DateTime($this->extraArgs()['CreatedDateTime'], new DateTimeZone($timezone)); |
|
21 | |||
22 | 1 | return $createdDateTime; |
|
23 | 1 | } catch (Throwable $e) { |
|
24 | 1 | return null; |
|
25 | } |
||
78 |