[add] Injecting dependency

This commit is contained in:
2018-08-05 04:30:50 -06:00
parent 2920fdd89b
commit 09f11ebe49
3 changed files with 10 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
class SessionApplication{
// The to be connection
private $pdo = '';
private $cryptographyService;
function __construct($mysqlSettings, $cryptographyService){
// Services
@@ -33,9 +34,13 @@ class SessionApplication{
function newSession($userName, $password){
$real = 'slothness';
$password = "$2y$12$51mfESaLEGXDT4u9Bd9kiOHEpaJ1Bx4SEcVwsU5K6jVPMNkrnpJAa";
if($this->cryptographyService->decryptPassword($real, $password)){
return "yea";
}
else{
"nah";
}
}
}