Last active
August 29, 2015 14:02
-
-
Save Bolinha1/ca6b212261b963fc2186 to your computer and use it in GitHub Desktop.
Classe que realiza login para diversos usuários.
This file contains hidden or 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 | |
| namespace Login; | |
| use Login\User; | |
| class Login | |
| { | |
| public function validate(User $user) | |
| { | |
| switch ($user->getType()) | |
| { | |
| case 'manager': | |
| printf(" yeah, manager..."); | |
| break; | |
| case 'seller': | |
| printf("yeah, seller..."); | |
| break; | |
| } | |
| } | |
| } |
This file contains hidden or 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 | |
| use Login\User; | |
| use Login\Login; | |
| $login = new Login(); | |
| $login->validate(new User('manager')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment