Skip to content

ISecurityUser

SecurityUser provides advanced security manipulation methods.

interface ISecurityUser

Implemented bySecurityUser
Since1.0.0
SourceUser/ISecurityUser.php
MethodDescription
addCredential(mixed $credential): voidAdd a credential to this user.
clearCredentials(): voidClear all credentials associated with this user.
hasCredentials(mixed $credential): boolIndicates whether or not this user has a credential.
isAuthenticated(): boolIndicates whether or not this user is authenticated.
removeCredential(mixed $credential): voidRemove a credential from this user.
setAuthenticated(mixed $authenticated): voidSet the authenticated status of this user.

abstract public function addCredential(mixed $credential): void

Add a credential to this user.

Credential data.

ParameterTypeDescription
$credentialmixedCredential data.

abstract public function clearCredentials(): void

Clear all credentials associated with this user.

abstract public function hasCredentials(mixed $credential): bool

Indicates whether or not this user has a credential.

Credential data.

ParameterTypeDescription
$credentialmixedCredential data.

Returns bool — true, if this user has the credential, otherwise false.

abstract public function isAuthenticated(): bool

Indicates whether or not this user is authenticated.

Returns bool — true, if this user is authenticated, otherwise false.

abstract public function removeCredential(mixed $credential): void

Remove a credential from this user.

Credential data.

ParameterTypeDescription
$credentialmixedCredential data.

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.

ParameterTypeDescription
$authenticatedmixedA 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.