| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | 12 | public function jsonSerialize(): array |
|
| 25 | { |
||
| 26 | 12 | $data = [ |
|
| 27 | 12 | 'type' => $this->type->value, |
|
| 28 | 12 | ]; |
|
| 29 | |||
| 30 | 12 | if ($this->onCancel !== null && !empty($this->onCancel)) { |
|
| 31 | 3 | $data['onCancel'] = $this->onCancel; |
|
| 32 | } |
||
| 33 | |||
| 34 | 12 | if ($this->when !== null) { |
|
| 35 | 3 | $data['when'] = $this->when; |
|
| 36 | } |
||
| 37 | |||
| 38 | 12 | return $data; |
|
| 39 | } |
||
| 41 |