| Total Complexity | 11 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 76% |
| Changes | 6 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 9 | class Season extends Base { |
||
| 10 | |||
| 11 | 2 | public function getCreatedDateTime(string $timezone = 'America/New_York') : ?DateTime { |
|
| 12 | |||
| 13 | // Check if 'CreatedDateTime' is present in the extra args |
||
| 14 | 2 | if (!isset($this->extraArgs()['CreatedDateTime'])) { |
|
| 15 | 1 | return null; // or throw an exception if required |
|
| 16 | } |
||
| 17 | |||
| 18 | try { |
||
| 19 | 1 | $createdDateTime = new DateTime($this->extraArgs()['CreatedDateTime'], new DateTimeZone($timezone)); |
|
| 20 | |||
| 21 | 1 | return $createdDateTime; |
|
| 22 | } catch (Throwable $e) { |
||
| 23 | return null; |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | 1 | public function getDescription(): string |
|
| 30 | } |
||
| 31 | |||
| 32 | 2 | public function getEndDateTime(string $timezone = 'America/New_York') : ?DateTime |
|
| 33 | { |
||
| 34 | // Check if 'EndDateTime' is present in the extra args |
||
| 35 | 2 | if (!isset($this->extraArgs()['EndDateTime'])) { |
|
| 36 | 1 | return null; |
|
| 37 | } |
||
| 38 | |||
| 39 | try { |
||
| 40 | 1 | $endDateTime = new DateTime($this->extraArgs()['EndDateTime'], new DateTimeZone($timezone)); |
|
| 41 | |||
| 42 | 1 | return $endDateTime; |
|
| 43 | } catch (Throwable $e) { |
||
| 44 | return null; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | 1 | public function getId(): int |
|
| 51 | } |
||
| 52 | |||
| 53 | 2 | public function getStartDateTime(string $timezone = 'America/New_York') : ?\DateTime |
|
| 68 | } |