We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ 30-42 (lines=13) @@ | ||
27 | * |
|
28 | * @return Connection |
|
29 | */ |
|
30 | public function backward($args, $total) |
|
31 | { |
|
32 | $args = $this->protectArgs($args); |
|
33 | $limit = $args['last']; |
|
34 | $offset = max(0, ConnectionBuilder::getOffsetWithDefault($args['before'], $total) - $limit); |
|
35 | ||
36 | $entities = call_user_func($this->fetcher, $offset, $limit); |
|
37 | ||
38 | return ConnectionBuilder::connectionFromArraySlice($entities, $args, [ |
|
39 | 'sliceStart' => $offset, |
|
40 | 'arrayLength' => $total, |
|
41 | ]); |
|
42 | } |
|
43 | ||
44 | /** |
|
45 | * @param Argument|array $args |
|
@@ 49-62 (lines=14) @@ | ||
46 | * |
|
47 | * @return Connection |
|
48 | */ |
|
49 | public function forward($args) |
|
50 | { |
|
51 | $args = $this->protectArgs($args); |
|
52 | $limit = $args['first']; |
|
53 | $offset = ConnectionBuilder::getOffsetWithDefault($args['after'], 0); |
|
54 | ||
55 | // The extra fetched element is here to determine if there is a next page. |
|
56 | $entities = call_user_func($this->fetcher, $offset, $limit + 1); |
|
57 | ||
58 | return ConnectionBuilder::connectionFromArraySlice($entities, $args, [ |
|
59 | 'sliceStart' => $offset, |
|
60 | 'arrayLength' => $offset + count($entities), |
|
61 | ]); |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @param Argument|array $args |