Last active
January 5, 2019 19:05
-
-
Save joaorobertopb/f847e00604996d1a7a7602effa602d79 to your computer and use it in GitHub Desktop.
Exemplo de código PHP com injeção de dependência via construtor.
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 | |
use MySQLConnection; | |
class PasswordReminder | |
{ | |
private $dbConnection; | |
public function __construct(MySQLConnection $dbConnection) | |
{ | |
$this->dbConnection = $dbConnection; | |
} | |
// Faz alguma coisa | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment