You are here

class Punctuation_Constraint in Password Policy 5

Hierarchy

Expanded class hierarchy of Punctuation_Constraint

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

File

constraints/constraint_punctuation.php, line 5

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

}

Members