logger = $logger; $this->db = $db; $this->userList = $config ? $config : []; } /** * Authenticate user. * * @param $username The username for authentication * @param $password The password for authentication * * @return true if valid false otherwise */ public function authenticate(string $username, string $password) : bool { if (!array_key_exists($username, $this->userList)) { return false; } return password_verify($password, $this->userList[$username]); } }