You are here

public function PasswordPolicyConstraint::messages in Password Policy 7.2

Gets messages for active constraint.

Return value

string[] Messages.

1 call to PasswordPolicyConstraint::messages()
PasswordPolicyConstraint::failMessages in includes/PasswordPolicyConstraint.inc
Gets messages indicating password failed to meet constraint.

File

includes/PasswordPolicyConstraint.inc, line 38
Contains PasswordPolicyConstraint.

Class

PasswordPolicyConstraint
Class PasswordPolicyConstraint.

Code

public function messages() {
  $mes_temp = is_array($this->info['message']) ? $this->info['message'] : array(
    $this->info['message'],
  );
  $messages = array();
  foreach ($mes_temp as $id => $message) {

    // Only show messages for constraints that have been configured.
    if ($this->config != $this->info['config']) {
      $args = array();
      foreach ($this->config as $key => $value) {
        $args['@' . $key] = $value;
      }
      $messages[$id] = format_string($message, $args);
    }
  }
  return $messages;
}