Conditions | 7 |
Paths | 64 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
56 | 2 | public function toArray(): array |
|
57 | { |
||
58 | 2 | $json = []; |
|
59 | |||
60 | 2 | if (isset($this->meta)) { |
|
61 | 2 | $json[Members::META] = $this->meta; |
|
62 | } |
||
63 | 2 | if (isset($this->links)) { |
|
64 | 2 | $json[Members::LINKS] = $this->links; |
|
65 | } |
||
66 | 2 | if (isset($this->errors)) { |
|
67 | 1 | $json[Members::ERRORS] = $this->errors; |
|
68 | } |
||
69 | 2 | if (isset($this->data)) { |
|
70 | 1 | $json[Members::DATA] = $this->data->toArray(); |
|
71 | } |
||
72 | 2 | if (isset($this->included)) { |
|
73 | 1 | $json[Members::INCLUDED] = $this->included->toArray(); |
|
74 | } |
||
75 | 2 | if (isset($this->jsonapi)) { |
|
76 | 2 | $json[Members::JSONAPI] = $this->jsonapi; |
|
77 | } |
||
78 | |||
79 | 2 | return $json; |
|
80 | } |
||
92 |