| Conditions | 5 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | public function process(object $object, array $data): array |
||
| 21 | { |
||
| 22 | if ($object instanceof LessonInterface) { |
||
| 23 | $previous = $this->lessonRepository->getPreviousInModule($object); |
||
| 24 | $next = $this->lessonRepository->getNextInModule($object); |
||
| 25 | $data['pagination'] = array_merge(isset($data['pagination']) ? $data['pagination'] : [], [ |
||
| 26 | 'prev_lesson_id' => $previous ? $previous->getId() : null, |
||
| 27 | 'next_lesson_id' => $next ? $next->getId() : null, |
||
| 28 | ]); |
||
| 29 | } |
||
| 30 | |||
| 31 | return $data; |
||
| 32 | } |
||
| 34 |