You are here

interface PasswordConstraintInterface in Password Policy 8.3

An interface to define the expected operations of a password constraint.

Hierarchy

Expanded class hierarchy of PasswordConstraintInterface

All classes that implement PasswordConstraintInterface

File

src/PasswordConstraintInterface.php, line 13

Namespace

Drupal\password_policy
View source
interface PasswordConstraintInterface extends PluginInspectionInterface, ConfigurableInterface, PluginFormInterface {

  /**
   * Returns a true/false status if the password meets the constraint.
   *
   * @param string $password
   *   The password entered by the end user.
   * @param \Drupal\user\UserInterface
   *   The user which password is changed.
   *
   * @return PasswordPolicyValidation
   *   Whether or not the password meets the constraint in the plugin.
   */
  public function validate($password, UserInterface $user);

  /**
   * Returns a translated string for the constraint title.
   *
   * @return string
   *   Title of the constraint.
   */
  public function getTitle();

  /**
   * Returns a translated description for the constraint description.
   *
   * @return string
   *   Description of the constraint.
   */
  public function getDescription();

  /**
   * Returns a translated error message for the constraint.
   *
   * @return string
   *   Error message if the constraint fails.
   */
  public function getErrorMessage();

  /**
   * Returns a human-readable summary of the constraint.
   *
   * @return string
   *   Summary of the constraint behaviors or restriction.
   */
  public function getSummary();

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
PasswordConstraintInterface::getDescription public function Returns a translated description for the constraint description. 1
PasswordConstraintInterface::getErrorMessage public function Returns a translated error message for the constraint. 1
PasswordConstraintInterface::getSummary public function Returns a human-readable summary of the constraint. 6
PasswordConstraintInterface::getTitle public function Returns a translated string for the constraint title. 1
PasswordConstraintInterface::validate public function Returns a true/false status if the password meets the constraint. 6
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2