| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | public function findAllPaginated(int $page, int $max_per_page): Paginator |
||
| 17 | { |
||
| 18 | $qb = $this->createQueryBuilder('l')->orderBy('l.created_at', 'DESC'); |
||
| 19 | $query = $qb->getQuery(); |
||
| 20 | |||
| 21 | $first_result = ($page - 1) * $max_per_page; |
||
| 22 | $query->setFirstResult($first_result)->setMaxResults($max_per_page); |
||
| 23 | $paginator = new Paginator($query); |
||
| 24 | |||
| 25 | if (($paginator->count() <= $first_result) && $page != 1) { |
||
| 26 | throw new NotFoundHttpException('La page demandée n\'existe pas.'); |
||
| 27 | } |
||
| 28 | |||
| 29 | return $paginator; |
||
| 30 | } |
||
| 32 |
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