| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 2 | public function fromData(?array $data): ?Event |
|
| 14 | { |
||
| 15 | 2 | if (!$data) { |
|
| 16 | 1 | return null; |
|
| 17 | } |
||
| 18 | |||
| 19 | 1 | return new Event( |
|
| 20 | 1 | $this->extractDateTimeImmutableOrNull('start_time', $data), |
|
| 21 | 1 | $this->extractDateTimeImmutableOrNull('end_time', $data), |
|
| 22 | 1 | $this->extractDateTimeImmutableOrNull('urls_expire_time', $data), |
|
| 23 | 1 | $this->extractBoolean('has_sound', $data), |
|
| 24 | 1 | $this->extractBoolean('has_motion', $data), |
|
| 25 | 1 | $this->extractBoolean('has_person', $data), |
|
| 26 | 1 | $this->extractString('web_url', $data), |
|
| 27 | 1 | $this->extractString('app_url', $data) |
|
| 28 | ); |
||
| 31 |