| 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 |
||
| 26 | 3 | public function jsonSerialize(): array |
|
| 27 | { |
||
| 28 | 3 | $data = parent::jsonSerialize(); |
|
| 29 | |||
| 30 | 3 | if ($this->command !== null) { |
|
| 31 | 2 | $data['command'] = $this->command->value; |
|
| 32 | } |
||
| 33 | |||
| 34 | 3 | if ($this->componentId !== null) { |
|
| 35 | 2 | $data['componentId'] = $this->componentId; |
|
| 36 | } |
||
| 37 | |||
| 38 | 3 | if ($this->value !== null) { |
|
| 39 | 1 | $data['value'] = $this->value; |
|
| 40 | } |
||
| 41 | |||
| 42 | 3 | return $data; |
|
| 43 | } |
||
| 45 |