Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | 10 | public function jsonSerialize(): array |
|
18 | { |
||
19 | 10 | $data = [ |
|
20 | 10 | 'name' => $this->name, |
|
21 | 10 | 'type' => $this->type, |
|
22 | 10 | ]; |
|
23 | |||
24 | 10 | if ($this->default !== null) { |
|
25 | 7 | $data['default'] = $this->default; |
|
26 | } |
||
27 | |||
28 | 10 | if ($this->description !== null) { |
|
29 | 3 | $data['description'] = $this->description; |
|
30 | } |
||
31 | |||
32 | 10 | return $data; |
|
33 | } |
||
35 |