| Conditions | 8 |
| Paths | 16 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 8 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | 4 | public function jsonSerialize(): array |
|
| 27 | { |
||
| 28 | 4 | $data = parent::jsonSerialize(); |
|
| 29 | |||
| 30 | 4 | if ($this->componentId !== null) { |
|
| 31 | 3 | $data['componentId'] = $this->componentId; |
|
| 32 | } |
||
| 33 | |||
| 34 | 4 | if ($this->commands !== null && !empty($this->commands)) { |
|
| 35 | 2 | $data['commands'] = $this->commands; |
|
| 36 | } |
||
| 37 | |||
| 38 | 4 | if ($this->data !== null && !empty($this->data)) { |
|
| 39 | 1 | $data['data'] = $this->data; |
|
| 40 | } |
||
| 41 | |||
| 42 | 4 | if ($this->otherwise !== null && !empty($this->otherwise)) { |
|
| 43 | 1 | $data['otherwise'] = $this->otherwise; |
|
| 44 | } |
||
| 45 | |||
| 46 | 4 | return $data; |
|
| 47 | } |
||
| 49 |