| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5.2742 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | 3 | public function lastPerformanceDate(string $timezone = 'America/New_York'): DateTime|bool |
|
| 53 | { |
||
| 54 | try { |
||
| 55 | 3 | $timezone = new DateTimeZone($timezone); |
|
| 56 | 1 | } catch (Exception $e) { |
|
| 57 | 1 | throw new InvalidArgumentException($e->getMessage()); |
|
| 58 | } |
||
| 59 | |||
| 60 | 2 | $date = isset($this->response()['LastPerformanceDate']) ? $this->response()['LastPerformanceDate'] : false; |
|
| 61 | 2 | if ($date) { |
|
| 62 | try { |
||
| 63 | 1 | return DateTime::createFromFormat(' Y-m-d\TG:i:sp', $date, $timezone); |
|
| 64 | } catch (Exception $e) { |
||
| 65 | trigger_error($e->getMessage(), E_USER_ERROR); |
||
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | 1 | return false; |
|
| 80 |