mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Force type-hint and handle null value in ordering
This commit is contained in:
parent
dd21694544
commit
ae04172929
@ -73,19 +73,17 @@ final class ResultRepository implements ObjectRepository
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed|null $orderBy
|
||||
* @param mixed|null $limit
|
||||
* @param mixed|null $offset
|
||||
*
|
||||
* @return Result[]
|
||||
* @return array<Result>
|
||||
*/
|
||||
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);
|
||||
|
||||
if (null !== $orderBy) {
|
||||
foreach ($orderBy as $sort => $order) {
|
||||
$qb->addOrderBy('r.' . $sort, $order);
|
||||
}
|
||||
}
|
||||
|
||||
return $qb
|
||||
->select('r')
|
||||
|
Loading…
x
Reference in New Issue
Block a user