Skip to content

Instantly share code, notes, and snippets.

@IvsonEmidio
Created May 1, 2022 23:37
Show Gist options
  • Save IvsonEmidio/388d7e68c7beaa17f03fafcf3a1ef1d6 to your computer and use it in GitHub Desktop.
Save IvsonEmidio/388d7e68c7beaa17f03fafcf3a1ef1d6 to your computer and use it in GitHub Desktop.
SOLID - OCP - CORRECT EXAMPLE
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