Created
May 1, 2022 23:37
-
-
Save IvsonEmidio/388d7e68c7beaa17f03fafcf3a1ef1d6 to your computer and use it in GitHub Desktop.
SOLID - OCP - CORRECT EXAMPLE
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
interface IEmailSend { | |
send(): boolean; | |
} | |
class htmlEmail implements IEmailSend { | |
public function send () { | |
return util.sendEmail(this.email, this.user); | |
} | |
} | |
class plainTextEmail implements IEmailSend { | |
public function send () { | |
return util.sendEmail(this.email, this.user); | |
} | |
} | |
class numericEmail implements IEmailSend { | |
public function send () { | |
return util.sendEmail(this.email, this.user); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment