GenerateSecurePasswordEvent
extends Event
in package
Event to request a secure password to be generated
Tags
Table of Contents
Properties
- $context : PasswordContext
- $password : string|null
- $propagationStopped : bool
Methods
- __construct() : mixed
- Request a secure password to be generated.
- getContext() : PasswordContext
- Get the context this password should generated for.
- getPassword() : string|null
- Get the generated password.
- isPropagationStopped() : bool
- {@inheritDoc}
- setPassword() : void
- Set the generated password.
- stopPropagation() : void
- Stops the propagation of the event to further event listeners
Properties
$context
private
PasswordContext
$context
= PasswordContext::ACCOUNT
$password
private
string|null
$password
$propagationStopped
private
bool
$propagationStopped
= false
Tags
Methods
__construct()
Request a secure password to be generated.
public
__construct([PasswordContext $context = PasswordContext::ACCOUNT ]) : mixed
By default passwords are generated for the user account context,
this can be adjusted by passing another PasswordContext
.
Parameters
- $context : PasswordContext = PasswordContext::ACCOUNT
Tags
getContext()
Get the context this password should generated for.
public
getContext() : PasswordContext
Tags
Return values
PasswordContextgetPassword()
Get the generated password.
public
getPassword() : string|null
If a password generator is registered and successfully generated a password
that password can get read back. Otherwise null
is returned.
Tags
Return values
string|nullisPropagationStopped()
{@inheritDoc}
public
isPropagationStopped() : bool
Tags
Return values
boolsetPassword()
Set the generated password.
public
setPassword(string $password) : void
This is used by password generators to set the generated password.
Parameters
- $password : string
Tags
stopPropagation()
Stops the propagation of the event to further event listeners
public
stopPropagation() : void