| Conditions | 5 |
| Paths | 8 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 3 | public function jsonSerialize(): array |
|
| 34 | { |
||
| 35 | 3 | $data = []; |
|
| 36 | 3 | if ($this->authority) { |
|
| 37 | 3 | $data['authority'] = $this->authority; |
|
| 38 | } |
||
| 39 | 3 | if ($this->status) { |
|
| 40 | 3 | $data['status'] = $this->status; |
|
| 41 | } |
||
| 42 | 3 | if (!empty($this->values)) { |
|
| 43 | 3 | $data['values'] = []; |
|
| 44 | 3 | foreach ($this->values as $value) { |
|
| 45 | 3 | $data['values'][] = [ |
|
| 46 | 3 | 'value' => $value, |
|
| 47 | 3 | ]; |
|
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | 3 | return $data; |
|
| 52 | } |
||
| 54 |