You are here

class Digit_Constraint in Password Policy 5

Hierarchy

Expanded class hierarchy of Digit_Constraint

1 string reference to 'Digit_Constraint'
PasswordPolicyTest::testConstraints in tests/password_policy.test

File

constraints/constraint_digit.php, line 5

View source
class Digit_Constraint extends Character_Constraint {
  function _charIsValid($character) {
    return parent::_charIsValid($character) && ctype_digit($character);
  }
  function getDescription() {
    return t('Password must contain the specified minimum number of digits.');
  }
  function getValidationErrorMessage() {
    return t('Password must contain a minimum of %numChars %digits.', array(
      '%numChars' => $this->minimumConstraintValue,
      '%digits' => format_plural($this->minimumConstraintValue, t('digit'), t('digits')),
    ));
  }

}

Members