Total Complexity | 11 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 76% |
Changes | 7 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
10 | class Season extends Base |
||
11 | { |
||
12 | 2 | public function getCreatedDateTime(string $timezone = 'America/New_York'): ?DateTime |
|
13 | { |
||
14 | |||
15 | // Check if 'CreatedDateTime' is present in the extra args |
||
16 | 2 | if (!isset($this->extraArgs()['CreatedDateTime'])) { |
|
17 | 1 | return null; // or throw an exception if required |
|
18 | } |
||
19 | |||
20 | try { |
||
21 | 1 | $createdDateTime = new DateTime($this->extraArgs()['CreatedDateTime'], new DateTimeZone($timezone)); |
|
22 | |||
23 | 1 | return $createdDateTime; |
|
24 | } catch (Throwable $e) { |
||
25 | return null; |
||
26 | } |
||
27 | } |
||
28 | |||
29 | 1 | public function getDescription(): string |
|
32 | } |
||
33 | |||
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 | } |
||
48 | } |
||
49 | |||
50 | 1 | public function getId(): int |
|
53 | } |
||
54 | |||
55 | 2 | public function getStartDateTime(string $timezone = 'America/New_York'): ?\DateTime |
|
71 |