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