Skip to content

Instantly share code, notes, and snippets.

@samadfcibd
Last active July 3, 2020 12:00
Show Gist options
  • Save samadfcibd/d3511ebe7a7f65ebb70d02570e51a7af to your computer and use it in GitHub Desktop.
Save samadfcibd/d3511ebe7a7f65ebb70d02570e51a7af to your computer and use it in GitHub Desktop.
<?php
class GoogleAuthenticationService
{
public function authenticate($email)
{
return 'true';
}
}
class userLogin
{
public function login($email)
{
// DIP violates here
$google_authentication = new GoogleAuthenticationService();
$auth_result = $google_authentication->authenticate($email);
if ($auth_result) {
return true;
}
}
}
$login = new userLogin();
$login->login('samadocpl@gmail.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment