You are here

interface PasswordPolicyValidatorInterface in Password Policy 8.3

Interface PasswordPolicyValidatorInterface.

@package Drupal\password_policy

Hierarchy

Expanded class hierarchy of PasswordPolicyValidatorInterface

All classes that implement PasswordPolicyValidatorInterface

File

src/PasswordPolicyValidatorInterface.php, line 12

Namespace

Drupal\password_policy
View source
interface PasswordPolicyValidatorInterface {

  /**
   * Validates the given password.
   *
   * @param string $password
   *   The new password.
   * @param \Drupal\user\UserInterface $user
   *   The current user object.
   * @param array $edited_user_roles
   *   An optional array containing the edited user roles.
   *
   * @return bool
   *   True when the password is valid, else false.
   */
  public function validatePassword(string $password, UserInterface $user, array $edited_user_roles = []) : bool;

  /**
   * Builds the password policy constraints table rows.
   *
   * @param string $password
   *   The new password.
   * @param \Drupal\user\UserInterface $user
   *   The current user object.
   * @param array $edited_user_roles
   *   An optional array containing the edited user roles.
   *
   * @return array
   *   An array containing the constraints table rows.
   */
  public function buildPasswordPolicyConstraintsTableRows(string $password, UserInterface $user, array $edited_user_roles = []) : array;

}

Members

Namesort descending Modifiers Type Description Overrides
PasswordPolicyValidatorInterface::buildPasswordPolicyConstraintsTableRows public function Builds the password policy constraints table rows. 1
PasswordPolicyValidatorInterface::validatePassword public function Validates the given password. 1