| Conditions | 5 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function getOneById(string $lessonId): LessonInterface |
||
| 19 | { |
||
| 20 | $lesson = $this->lessonsRepository->getOneById($lessonId); |
||
| 21 | if ( |
||
| 22 | null === $lesson || |
||
| 23 | !$lesson->getModule() || |
||
| 24 | !$lesson->getModule()->getCourse() || |
||
| 25 | !$lesson->getModule()->getCourse()->isActive() |
||
| 26 | ) { |
||
| 27 | throw new NotFoundHttpException('Lesson was not found.'); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $lesson; |
||
| 31 | } |
||
| 33 |