InMemoryUserIdentity
A plain value-object PasswordProtectedUserIdentity, returned by every foundation UserProviderInterface implementation (InMemoryUserProvider, PdoUserProvider, CallableUserProvider).
Synopsis
Section titled “Synopsis”final class InMemoryUserIdentity implements PasswordProtectedUserIdentity
| Implements | PasswordProtectedUserIdentity |
| Since | 1.0.0 |
| Source | Identity/InMemoryUserIdentity.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(string $identifier, string $passwordHash, array<int, string> $roles = []): mixed
Roles/permissions to grant on the SecurityUser.
| Parameter | Type | Description |
|---|---|---|
$identifier | string | The stable identifier (e.g. email/username). |
$passwordHash | string | The stored password hash. |
$roles | array``<``int``, ``string``> | Roles/permissions to grant on the SecurityUser. |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
getIdentifier(): string | The value UserProviderInterface::loadByIdentifier() was called with (e.g. |
getPasswordHash(): string | |
getRoles(): array<int, string> |
getIdentifier()
Section titled “getIdentifier()”public function getIdentifier(): string
The value UserProviderInterface::loadByIdentifier() was called with (e.g.
an email or username) — stable across requests.
Returns string — This identity’s stable identifier.
getPasswordHash()
Section titled “getPasswordHash()”public function getPasswordHash(): string
Returns string — The stored password hash.
getRoles()
Section titled “getRoles()”public function getRoles(): array<int, string>
Returns array``<``int``, ``string``> — Roles/permissions to grant on the SecurityUser.