| Conditions | 4 |
| Paths | 8 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | 5 | public function jsonSerialize(): array |
|
| 25 | { |
||
| 26 | 5 | $data = parent::jsonSerialize(); |
|
| 27 | |||
| 28 | 5 | if ($this->componentId !== null) { |
|
| 29 | 4 | $data['componentId'] = $this->componentId; |
|
| 30 | } |
||
| 31 | |||
| 32 | 5 | if ($this->distance !== null) { |
|
| 33 | 4 | $data['distance'] = $this->distance; |
|
| 34 | } |
||
| 35 | |||
| 36 | 5 | if ($this->targetDuration !== null) { |
|
| 37 | 3 | $data['targetDuration'] = $this->targetDuration; |
|
| 38 | } |
||
| 39 | |||
| 40 | 5 | return $data; |
|
| 41 | } |
||
| 43 |