Register
in package
Use case for user registration.
Handles creating new user accounts.
Tags
Table of Contents
Properties
- $passwordHasher : PasswordHasher
- Password hasher.
- $repository : UserRepositoryInterface
- User repository.
Methods
- __construct() : mixed
- Create a new Register use case.
- execute() : User
- Execute the registration.
Properties
$passwordHasher
Password hasher.
private
PasswordHasher
$passwordHasher
$repository
User repository.
private
UserRepositoryInterface
$repository
Methods
__construct()
Create a new Register use case.
public
__construct(UserRepositoryInterface $repository[, PasswordHasher|null $passwordHasher = null ]) : mixed
Parameters
- $repository : UserRepositoryInterface
-
User repository
- $passwordHasher : PasswordHasher|null = null
-
Password hasher
execute()
Execute the registration.
public
execute(string $username, string $email, string $password) : User
Parameters
- $username : string
-
Username
- $email : string
-
Email address
- $password : string
-
Plain-text password
Tags
Return values
User —The created user