protected function validatePassword(string $inputPassword, string $expectedPassword)
{
// if username or password is NULL, return immediately
if ($inputPassword == null || $expectedPassword == null) {
return false;
}
// initialize the valid login flag
$valid = false;
// query whether or not we've to ignore the case
if ($this->ignorePasswordCase === true) {
$valid = $inputPassword->equalsIgnoreCase($expectedPassword);
} else {
$valid = $inputPassword->equals($expectedPassword);
}
// return the flag
return $valid;
}