-
-
Save pix-art/1725da6a13188a87ba6978401507ddc4 to your computer and use it in GitHub Desktop.
How to write complex function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CourseService { | |
... | |
public function signUp(SmartCode $code, User $user) | |
{ | |
// 1. Check if the code is valid | |
// 2. Check if the user already has a code for this course | |
// 3. Register the code | |
// 4. Enroll the user with his code | |
// 5. Return enrollment | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment