ISecurityUser
SecurityUser provides advanced security manipulation methods.
Synopsis
Section titled “Synopsis”interface ISecurityUser
| Implemented by | SecurityUser |
| Since | 1.0.0 |
| Source | User/ISecurityUser.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
addCredential(mixed $credential): void | Add a credential to this user. |
clearCredentials(): void | Clear all credentials associated with this user. |
hasCredentials(mixed $credential): bool | Indicates whether or not this user has a credential. |
isAuthenticated(): bool | Indicates whether or not this user is authenticated. |
removeCredential(mixed $credential): void | Remove a credential from this user. |
setAuthenticated(mixed $authenticated): void | Set the authenticated status of this user. |
addCredential()
Section titled “addCredential()”abstract public function addCredential(mixed $credential): void
Add a credential to this user.
Credential data.
| Parameter | Type | Description |
|---|---|---|
$credential | mixed | Credential data. |
clearCredentials()
Section titled “clearCredentials()”abstract public function clearCredentials(): void
Clear all credentials associated with this user.
hasCredentials()
Section titled “hasCredentials()”abstract public function hasCredentials(mixed $credential): bool
Indicates whether or not this user has a credential.
Credential data.
| Parameter | Type | Description |
|---|---|---|
$credential | mixed | Credential data. |
Returns bool — true, if this user has the credential, otherwise false.
isAuthenticated()
Section titled “isAuthenticated()”abstract public function isAuthenticated(): bool
Indicates whether or not this user is authenticated.
Returns bool — true, if this user is authenticated, otherwise false.
removeCredential()
Section titled “removeCredential()”abstract public function removeCredential(mixed $credential): void
Remove a credential from this user.
Credential data.
| Parameter | Type | Description |
|---|---|---|
$credential | mixed | Credential data. |
setAuthenticated()
Section titled “setAuthenticated()”abstract public function setAuthenticated(mixed $authenticated): void
Set the authenticated status of this user.
A flag indicating the authenticated status of this user.
Implementations are expected to reject truthy-but-non-bool values
(e.g. 1) rather than coerce them.
| Parameter | Type | Description |
|---|---|---|
$authenticated | mixed | A flag indicating the authenticated status of this user. Implementations are expected to reject truthy-but-non-bool values (e.g. 1) rather than coerce them. |