Class Result
Authentication result object
Constants
-
FAILURE_CREDENTIALS_INVALID ¶
'FAILURE_CREDENTIALS_INVALID'
Failure due to invalid credentials being supplied.
-
FAILURE_CREDENTIALS_MISSING ¶
'FAILURE_CREDENTIALS_MISSING'
The authentication credentials were not found in the request.
-
FAILURE_IDENTITY_NOT_FOUND ¶
'FAILURE_IDENTITY_NOT_FOUND'
Failure due to identity not being found.
-
FAILURE_OTHER ¶
'FAILURE_OTHER'
General failure due to any other circumstances.
-
SUCCESS ¶
'SUCCESS'
Authentication success.
Property Summary
Method Summary
-
__construct() public
Sets the result status, identity, and failure messages
-
getData() public
Returns the identity data used in the authentication attempt.
-
getErrors() public
Returns an array of string reasons why the authentication attempt was unsuccessful.
-
getStatus() public
Get the result status for this authentication attempt.
-
isValid() public
Returns whether the result represents a successful authentication attempt.
Method Detail
__construct() ¶ public
__construct(null|arrayArrayAccess $data, string $status, array $messages = [])
Sets the result status, identity, and failure messages
Parameters
-
null|arrayArrayAccess
$data The identity data
-
string
$status Status constant equivalent.
-
array
$messages optional Messages.
Throws
InvalidArgumentException
When invalid identity data is passed.
getData() ¶ public
getData(): ArrayAccess|array|null
Returns the identity data used in the authentication attempt.
Returns
ArrayAccess|array|null
getErrors() ¶ public
getErrors(): array
Returns an array of string reasons why the authentication attempt was unsuccessful.
If authentication was successful, this method returns an empty array.
Returns
array
getStatus() ¶ public
getStatus(): string
Get the result status for this authentication attempt.
Returns
string
isValid() ¶ public
isValid(): bool
Returns whether the result represents a successful authentication attempt.
Returns
bool
Property Detail
$_errors ¶ protected
An array of string reasons why the authentication attempt was unsuccessful
If authentication was successful, this should be an empty array.
Type
array