InMemoryUser
in package
implements
UserInterface, PasswordAuthenticatedUserInterface, EquatableInterface
FinalYes
UserInterface implementation used by the in-memory user provider.
This should not be used for anything else.
Tags
Table of Contents
Interfaces
- UserInterface
- Represents the interface that all user classes must implement.
- PasswordAuthenticatedUserInterface
- For users that can be authenticated using a password.
- EquatableInterface
- EquatableInterface used to test if two objects are equal in security and re-authentication context.
Properties
Methods
- __construct() : mixed
- __toString() : string
- eraseCredentials() : mixed
- Removes sensitive data from the user.
- getPassword() : string|null
- Returns the hashed password used to authenticate the user.
- getRoles() : array<string|int, string>
- Returns the roles granted to the user.
- getUserIdentifier() : string
- Returns the identifier for this user (e.g. its username or email address).
- isEnabled() : bool
- Checks whether the user is enabled.
- isEqualTo() : bool
- The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()).
Properties
$enabled
private
bool
$enabled
$password
private
string|null
$password
$roles
private
array<string|int, mixed>
$roles
$username
private
string
$username
Methods
__construct()
public
__construct(string|null $username, string|null $password[, array<string|int, mixed> $roles = [] ][, bool $enabled = true ]) : mixed
Parameters
- $username : string|null
- $password : string|null
- $roles : array<string|int, mixed> = []
- $enabled : bool = true
__toString()
public
__toString() : string
Return values
stringeraseCredentials()
Removes sensitive data from the user.
public
eraseCredentials() : mixed
getPassword()
Returns the hashed password used to authenticate the user.
public
getPassword() : string|null
Return values
string|nullgetRoles()
Returns the roles granted to the user.
public
getRoles() : array<string|int, string>
Return values
array<string|int, string>getUserIdentifier()
Returns the identifier for this user (e.g. its username or email address).
public
getUserIdentifier() : string
Return values
stringisEnabled()
Checks whether the user is enabled.
public
isEnabled() : bool
Internally, if this method returns false, the authentication system will throw a DisabledException and prevent login.
Tags
Return values
bool —true if the user is enabled, false otherwise
isEqualTo()
The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()).
public
isEqualTo(UserInterface $user) : bool
Parameters
- $user : UserInterface