Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function paginate(ServerRequestInterface $request, ObjectRepository $repository, array $where = [], $orderBy = []): ApiCollection |
||
16 | { |
||
17 | $params = $request->getQueryParams(); |
||
18 | $page = isset($params['page']) ? (int) $params['page'] : 1; |
||
19 | $limit = isset($params['limit']) ? (int) $params['limit'] : 25; |
||
20 | $offset = ($page * $limit) - $limit; |
||
21 | $collection = $repository->findBy($where, $orderBy, $limit, $offset); |
||
22 | $totalRecords = $repository->count($where); |
||
23 | $totalPages = (int) ceil($totalRecords / $limit); |
||
24 | $uri = $request->getUri(); |
||
25 | |||
26 | return new ApiCollection($collection, $uri, $page, $totalPages, $totalRecords); |
||
27 | } |
||
29 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths