Conditions | 4 |
Paths | 8 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
20 | 11 | public function toArray(): array |
|
21 | { |
||
22 | 11 | $resource = []; |
|
23 | |||
24 | 11 | $resource[Members::DATA] = is_null($this->data) ? $this->data : $this->data->toArray(); |
|
25 | |||
26 | 11 | if (isset($this->meta)) { |
|
27 | 6 | $resource[Members::META] = $this->meta; |
|
28 | } |
||
29 | 11 | if (isset($this->links)) { |
|
30 | 6 | $resource[Members::LINKS] = $this->links; |
|
31 | } |
||
32 | |||
33 | 11 | return $resource; |
|
34 | } |
||
57 |