| Total Complexity | 13 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Coverage | 79.31% |
| Changes | 7 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 11 | class Season extends Resource |
||
| 12 | { |
||
| 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 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | 1 | public function setCreatedDateTime(string $createdDateTime): void |
|
| 29 | { |
||
| 30 | 1 | $this->extraArgs['CreatedDateTime'] = $createdDateTime; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | public function getDescription(): string |
|
| 34 | { |
||
| 35 | 1 | return (string)$this->extraArgs()['Description']; |
|
| 36 | } |
||
| 37 | |||
| 38 | public function setDescription(string $description): void |
||
| 39 | { |
||
| 40 | $this->extraArgs['Description'] = $description; |
||
| 41 | } |
||
| 42 | |||
| 43 | 2 | public function getEndDateTime(string $timezone = 'America/New_York'): ?DateTime |
|
| 44 | { |
||
| 45 | 2 | if (!isset($this->extraArgs()['EndDateTime'])) { |
|
| 46 | 1 | return null; |
|
| 47 | } |
||
| 48 | |||
| 49 | try { |
||
| 50 | 1 | $endDateTime = new DateTime($this->extraArgs()['EndDateTime'], new DateTimeZone($timezone)); |
|
| 51 | |||
| 52 | 1 | return $endDateTime; |
|
| 53 | } catch (Throwable $e) { |
||
| 54 | return null; |
||
| 55 | } |
||
| 56 | } |
||
| 57 | |||
| 58 | 2 | public function getStartDateTime(string $timezone = 'America/New_York'): ?\DateTime |
|
| 59 | { |
||
| 60 | 2 | if (!isset($this->extraArgs()['StartDateTime'])) { |
|
| 61 | 1 | return null; |
|
| 62 | } |
||
| 63 | |||
| 64 | try { |
||
| 65 | 1 | $startDateTime = new DateTime($this->extraArgs()['StartDateTime'], new DateTimeZone($timezone)); |
|
| 66 | |||
| 67 | 1 | return $startDateTime; |
|
| 68 | } catch (Throwable $e) { |
||
| 69 | return null; |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 73 | 1 | public function setStartDateTime(string $startDateTime): void |
|
| 76 | } |
||
| 77 | } |
||
| 78 |