mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	Force type-hint and handle null value in ordering
This commit is contained in:
		| @@ -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<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); | ||||
|  | ||||
|         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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user