public function getCredentialValidationCallback()
    {
        if ($this->checkOldHashes) {
            $credentialValidationCallback = function($dbCredential, $requestCredential) {
                if (password_verify($requestCredential, $dbCredential)) {
                    return true;
                } elseif ($dbCredential == $this->hashOldPassword($requestCredential)) {
                    return true;
                }

                return false;
            };
        } else {
            $credentialValidationCallback = function($dbCredential, $requestCredential) {
                if (password_verify($requestCredential, $dbCredential)) {
                    return true;
                }

                return false;
            };
        }

        return $credentialValidationCallback;
    }