| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function link(User $currentUser, User $student) { |
||
| 26 | $studentEduPerson = $student->getType()->getEduPerson(); |
||
| 27 | |||
| 28 | if(!in_array(static::StudentEduPerson, $studentEduPerson)) { |
||
| 29 | throw new NotAStudentException(); |
||
| 30 | } |
||
| 31 | |||
| 32 | $ids = explode(',', $currentUser->getExternalId()); |
||
| 33 | $ids[] = $student->getExternalId(); |
||
| 34 | $currentUser->setExternalId(implode(',', $ids)); |
||
| 35 | |||
| 36 | $this->repository->persist($currentUser); |
||
| 37 | } |
||
| 59 | } |