diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php index 407626afe..327f396db 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -73,18 +73,16 @@ final class ResultRepository implements ObjectRepository } /** - * @param mixed|null $orderBy - * @param mixed|null $limit - * @param mixed|null $offset - * - * @return Result[] + * @return array */ - public function findByGoal(Goal $goal, $orderBy = null, $limit = null, $offset = null): array + public function findByGoal(Goal $goal, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryByGoal($goal); - foreach ($orderBy as $sort => $order) { - $qb->addOrderBy('r.' . $sort, $order); + if (null !== $orderBy) { + foreach ($orderBy as $sort => $order) { + $qb->addOrderBy('r.' . $sort, $order); + } } return $qb