Last active
June 29, 2018 19:47
-
-
Save nahidulhasan/d12bcb4118ad52fbc40d3b195969ffc7 to your computer and use it in GitHub Desktop.
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
<?php | |
interface ConnectionInterface | |
{ | |
public function connect(); | |
} | |
class DbConnection implements ConnectionInterface | |
{ | |
/** | |
* db connection | |
*/ | |
public function connect() | |
{ | |
var_dump('MYSQL Connection'); | |
} | |
} | |
class PasswordReminder | |
{ | |
/** | |
* @var MySQLConnection | |
*/ | |
private $dbConnection; | |
public function __construct(ConnectionInterface $dbConnection) | |
{ | |
$this->dbConnection = $dbConnection; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In line 22
MySQLConnection
should be replaced withConnectionInterface
, too.