Conditions | 4 |
Paths | 8 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function toArray(): array |
||
15 | { |
||
16 | $resource = []; |
||
17 | |||
18 | $resource[Members::DATA] = is_null($this->data) ? $this->data : $this->data->toArray(); |
||
19 | |||
20 | if (isset($this->meta)) { |
||
21 | $resource[Members::META] = $this->meta; |
||
22 | } |
||
23 | if (isset($this->links)) { |
||
24 | $resource[Members::LINKS] = $this->links; |
||
25 | } |
||
26 | |||
27 | return $resource; |
||
28 | } |
||
30 |