| Conditions | 4 |
| Paths | 8 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 15 | public function toArray(): array |
|
| 34 | { |
||
| 35 | 15 | $data = []; |
|
| 36 | |||
| 37 | 15 | if ($this->hasMetadata()) { |
|
| 38 | 4 | $data['meta'] = $this->getMetadata(); |
|
| 39 | } |
||
| 40 | |||
| 41 | 15 | if ($this->hasLinks()) { |
|
| 42 | 4 | $data['links'] = $this->linksToArray(); |
|
| 43 | } |
||
| 44 | |||
| 45 | 15 | if ($this->hasErrors()) { |
|
| 46 | 4 | $data['errors'] = $this->errorsToArray(); |
|
| 47 | } |
||
| 48 | |||
| 49 | 15 | return $data; |
|
| 50 | } |
||
| 51 | } |