Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
26 | private function mapMetadataFromEntity(Result $result) |
||
27 | { |
||
28 | $data = [ |
||
29 | 'total' => $result->getTotalCount(), |
||
30 | 'has_next' => $result->hasNext(), |
||
31 | 'has_previous' => $result->hasPrevious(), |
||
32 | ]; |
||
33 | |||
34 | if ($result->getNextCursor() !== null) { |
||
35 | $data['cursors']['after'] = $result->getNextCursor(); |
||
36 | } |
||
37 | if ($result->getPreviousCursor() !== null) { |
||
38 | $data['cursors']['before'] = $result->getPreviousCursor(); |
||
39 | } |
||
40 | |||
41 | return $data; |
||
42 | } |
||
43 | |||
49 |