Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
55 | public function toArray() : array |
||
56 | { |
||
57 | $result = [ |
||
58 | 'summary' => $this->summary, |
||
59 | 'description' => $this->description, |
||
60 | ]; |
||
61 | |||
62 | // The `value` field and `externalValue` field are mutually exclusive. |
||
63 | if (isset($this->value)) { |
||
64 | $result['value'] = $this->value; |
||
65 | } elseif (isset($this->externalValue)) { |
||
66 | $result['externalValue'] = $this->externalValue; |
||
67 | } |
||
68 | |||
69 | return $result; |
||
70 | } |
||
72 |