| Conditions | 7 |
| Paths | 32 |
| Total Lines | 25 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 7 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | 5 | public function jsonSerialize(): array |
|
| 28 | { |
||
| 29 | 5 | $data = []; |
|
| 30 | |||
| 31 | 5 | if ($this->command !== null) { |
|
| 32 | 1 | $data['command'] = $this->command; |
|
| 33 | } |
||
| 34 | |||
| 35 | 5 | if ($this->commands !== null && !empty($this->commands)) { |
|
| 36 | 1 | $data['commands'] = $this->commands; |
|
| 37 | } |
||
| 38 | |||
| 39 | 5 | if (!$this->enabled) { |
|
| 40 | 2 | $data['enabled'] = $this->enabled; |
|
| 41 | } |
||
| 42 | |||
| 43 | 5 | if ($this->label !== null) { |
|
| 44 | 1 | $data['label'] = $this->label; |
|
| 45 | } |
||
| 46 | |||
| 47 | 5 | if ($this->name !== null) { |
|
| 48 | 1 | $data['name'] = $this->name; |
|
| 49 | } |
||
| 50 | |||
| 51 | 5 | return $data; |
|
| 52 | } |
||
| 54 |