protected function applyMinMaxStrings($minimum, $maximum)
    {
        if ($minimum && $maximum) {
            $errorString = t('A password must be between %s and %s characters long.', $minimum->getMinimumLength(), $maximum->getMaximumLength());
            $requirement = t('Must be between %s and %s characters long.', $minimum->getMinimumLength(), $maximum->getMaximumLength());
        } elseif ($minimum) {
            $errorString = t('Must be at least %s characters long.', $minimum->getMinimumLength());
            $requirement = t('A password must be at least %s characters long.', $minimum->getMinimumLength());
        } elseif ($maximum) {
            $errorString = t('A password must be at most %s characters long.', $maximum->getMaximumLength());
            $requirement = t('Must be at most %s characters long.', $maximum->getMaximumLength());
        } else {
            $errorString = t('Invalid Password.');
            $requirement = '';
        }

        $errorHandler = function ($validator, $code, $password) use ($errorString) { return $errorString; };
        $requirementHandler = function ($validator, $code) use (&$requirement) { return $requirement; };
        $minimum->setRequirementString($minimum::E_TOO_SHORT, $requirementHandler);
        $minimum->setErrorString($minimum::E_TOO_SHORT, $errorHandler);

        $maximum->setRequirementString($maximum::E_TOO_LONG, $requirementHandler);
        $maximum->setErrorString($maximum::E_TOO_LONG, $errorHandler);
    }