You are here

class Letter_Constraint in Password Policy 5

Hierarchy

Expanded class hierarchy of Letter_Constraint

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

File

constraints/constraint_letter.php, line 5

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

}

Members