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