| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function getCourseAttachments( |
||
| 31 | SerializerInterface $serializer, |
||
| 32 | AttachmentRepositoryInterface $attachmentRepository, |
||
| 33 | int $courseId |
||
| 34 | ): Response { |
||
| 35 | $course = $this->courseRepository->getOneById($courseId); |
||
| 36 | if (null === $course) { |
||
| 37 | throw new NotFoundHttpException('Course was not found'); |
||
| 38 | } |
||
| 39 | |||
| 40 | return new Response($serializer->serialize($attachmentRepository->getAllForCourse($course), 'json', ['groups' => ['attachments_list']])); |
||
| 41 | } |
||
| 43 |