Skip to content

Instantly share code, notes, and snippets.

@IvsonEmidio
Created May 1, 2022 23:29
Show Gist options
  • Save IvsonEmidio/55deabb979e6fde0910ebfdb1b08f3f0 to your computer and use it in GitHub Desktop.
Save IvsonEmidio/55deabb979e6fde0910ebfdb1b08f3f0 to your computer and use it in GitHub Desktop.
SOLID - OCP - VIOLATION - EXAMPLE 2
class clients {
public function sendEmail (emailType: string){
if (emailType === 'html'){
let email = parseHtml(this.email);
} else if (emailType === 'plainText'){
let email = parsePlainText(this.email);
} else if (emailType === 'numeric') {
let email = parseNumeric(this.email);
}
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