Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.2098 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 2 | public function getEndDateTime(string $timezone = 'America/New_York'): ?DateTime |
|
35 | { |
||
36 | // Check if 'EndDateTime' is present in the extra args |
||
37 | 2 | if (!isset($this->extraArgs()['EndDateTime'])) { |
|
38 | 1 | return null; |
|
39 | } |
||
40 | |||
41 | try { |
||
42 | 1 | $endDateTime = new DateTime($this->extraArgs()['EndDateTime'], new DateTimeZone($timezone)); |
|
43 | |||
44 | 1 | return $endDateTime; |
|
45 | } catch (Throwable $e) { |
||
46 | return null; |
||
47 | } |
||
71 |