Skip to content

Instantly share code, notes, and snippets.


pix-art/CourseService.php Secret

Last active Apr 14, 2016
What would you like to do?
How to write a complex function
class CourseService {
public function signUp(SmartCode $code, User $user)
$course = $code->getPayload();
$this->guardThatUserIsNotSignedUp($user, $course);
$this->smartCodeService->register($user, $code);
$enrollment = $this->smartCodeEnrollment->enroll($user, $course);
return $enrollment;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment