| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function get(string $userId):array |
||
| 19 | { |
||
| 20 | $practisesToReturn = []; |
||
| 21 | $practises = $this->interactionsRepository->getDoneByUser($userId); |
||
| 22 | foreach ($practises as $practise){ |
||
| 23 | $year = $practise->doneAt() !== null ? $practise->doneAt()->format('Y') : 'Non datée'; |
||
| 24 | $practisesToReturn[$year][] = $practise->toArray(); |
||
| 25 | } |
||
| 26 | |||
| 27 | krsort($practisesToReturn, SORT_NUMERIC); |
||
| 28 | |||
| 29 | return $practisesToReturn; |
||
| 30 | } |
||
| 32 |