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 | |
interface AuthenticationService | |
{ | |
public function authenticate($email); | |
} | |
class GoogleAuthenticationService implements AuthenticationService | |
{ | |
public function authenticate($email) |
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 | |
class GoogleAuthenticationService | |
{ | |
public function authenticate($email) | |
{ | |
return 'true'; | |
} | |
} |
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 | |
interface PrinterInterface | |
{ | |
public function print(); | |
} | |
interface PhotocopyInterface | |
{ | |
public function photocopy(); |
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 | |
interface PrinterInterface | |
{ | |
public function print(); | |
public function photocopy(); | |
public function scan(); | |
} |
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 | |
abstract class PaymentStatusService | |
{ | |
public abstract function getStatus($payment_id); | |
} | |
class CreditCardPaymentStatus extends PaymentStatusService | |
{ | |
public function getStatus($payment_id) |
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 | |
interface paymentInterface | |
{ | |
public function pay(); | |
} | |
class payWithPaypal implements paymentInterface | |
{ | |
public function pay() |
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 | |
class PaymentService | |
{ | |
public function payWithPaypal() | |
{ | |
// pay with paypal | |
} | |
public function payWithCreditCard() |
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 | |
class userInfo | |
{ | |
public function getUserName() | |
{ | |
return 'name'; | |
} | |
public function getUserAddress() |
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 | |
class userInfo | |
{ | |
public function getUserName() | |
{ | |
return 'name'; | |
} | |
// Here SRP violates |
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
# Python needs a MySQL driver to access the MySQL database. | |
import mysql.connector | |
# Start by creating a connection to the database. | |
mydb = mysql.connector.connect( | |
host="192.168.152.221", | |
user="ocpl", | |
passwd="ocpl@321", |
NewerOlder