AuthenticationException
extends DomainException
in package
Basic exception for domain errors
Table of Contents
Properties
- $context : array<string|int, mixed>
- $errorCode : string
- $httpStatusCode : int
Methods
- __construct() : mixed
- emptyCredentials() : self
- Thrown when no credentials given
- invalidCredentials() : self
- Thrown when invalid announcements given
- noUserLoggedIn() : self
- Thrown when no user logged in
- unauthorized() : self
- Thrown when a user is not authorized to perform an action
- userNotFound() : self
- Thrown when user is not found
Properties
$context read-only
public
array<string|int, mixed>
$context
= []
$errorCode read-only
public
string
$errorCode
$httpStatusCode read-only
public
int
$httpStatusCode
= 400
Methods
__construct()
public
__construct(string $message, string $errorCode[, int $httpStatusCode = 400 ][, array<string|int, mixed> $context = [] ][, Throwable|null $previous = null ]) : mixed
Parameters
- $message : string
- $errorCode : string
- $httpStatusCode : int = 400
- $context : array<string|int, mixed> = []
- $previous : Throwable|null = null
emptyCredentials()
Thrown when no credentials given
public
static emptyCredentials() : self
Return values
selfinvalidCredentials()
Thrown when invalid announcements given
public
static invalidCredentials() : self
Return values
selfnoUserLoggedIn()
Thrown when no user logged in
public
static noUserLoggedIn([Throwable|null $previous = null ]) : self
Parameters
- $previous : Throwable|null = null
Return values
selfunauthorized()
Thrown when a user is not authorized to perform an action
public
static unauthorized(int $userId[, Throwable|null $previous = null ]) : self
Parameters
- $userId : int
- $previous : Throwable|null = null
Return values
selfuserNotFound()
Thrown when user is not found
public
static userNotFound() : self