interface PasswordGeneratorInterface

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Password/PasswordGeneratorInterface.php \Drupal\Core\Password\PasswordGeneratorInterface
  2. 10 core/lib/Drupal/Core/Password/PasswordGeneratorInterface.php \Drupal\Core\Password\PasswordGeneratorInterface

Interface for generating passwords.

Hierarchy

Expanded class hierarchy of PasswordGeneratorInterface

All classes that implement PasswordGeneratorInterface

2 files declare their use of PasswordGeneratorInterface
UserRegistrationResource.php in core/modules/user/src/Plugin/rest/resource/UserRegistrationResource.php
UserRegistrationResourceTest.php in core/modules/user/tests/src/Unit/UserRegistrationResourceTest.php

File

core/lib/Drupal/Core/Password/PasswordGeneratorInterface.php, line 8

Namespace

Drupal\Core\Password
View source
interface PasswordGeneratorInterface {
    
    /**
     * Generates a password.
     *
     * @param int $length
     *   (optional) The length of the password.
     *
     * @return string
     *   The password.
     */
    public function generate(int $length = 10) : string;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
PasswordGeneratorInterface::generate public function Generates a password. 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.