AnnouncementException
extends DomainException
in package
FinalYes
Announcement domain exceptions
Table of Contents
Properties
- $context : array<string|int, mixed>
- $errorCode : string
- $httpStatusCode : int
Methods
- __construct() : mixed
- emptyText() : self
- Text is empty or too short
- emptyTitle() : self
- Title is empty or too short
- expirationInThePast() : self
- Thrown when the expiration date is in the past
- expirationTooFarInFuture() : self
- Set expiration date is too far in the future
- failedToDelete() : self
- Failed to delete an announcement
- failedToUpdate() : self
- Failed to update an announcement
- failedToUpdateStatus() : self
- Failed to change the status of an announcement
- invalidId() : self
- Invalid or missing announcement ID
- invalidStatus() : self
- Invalid announcement status
- notFound() : self
- Announcement isn't found in a database
- textTooLong() : self
- Text is too long
- textTooShort() : self
- Text is too short
- titleTooLong() : self
- Title is too long
- titleTooShort() : self
- Title is too short
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
emptyText()
Text is empty or too short
public
static emptyText() : self
Return values
selfemptyTitle()
Title is empty or too short
public
static emptyTitle() : self
Return values
selfexpirationInThePast()
Thrown when the expiration date is in the past
public
static expirationInThePast() : self
Return values
selfexpirationTooFarInFuture()
Set expiration date is too far in the future
public
static expirationTooFarInFuture() : self
Return values
selffailedToDelete()
Failed to delete an announcement
public
static failedToDelete(AnnouncementId $id) : self
Parameters
- $id : AnnouncementId
Return values
selffailedToUpdate()
Failed to update an announcement
public
static failedToUpdate() : self
Return values
selffailedToUpdateStatus()
Failed to change the status of an announcement
public
static failedToUpdateStatus() : self
Return values
selfinvalidId()
Invalid or missing announcement ID
public
static invalidId(AnnouncementId $id) : self
Parameters
- $id : AnnouncementId
Return values
selfinvalidStatus()
Invalid announcement status
public
static invalidStatus(string $status) : self
Parameters
- $status : string
Return values
selfnotFound()
Announcement isn't found in a database
public
static notFound(AnnouncementId $id) : self
Parameters
- $id : AnnouncementId
Return values
selftextTooLong()
Text is too long
public
static textTooLong(int $maxTextLength) : self
Parameters
- $maxTextLength : int
Return values
selftextTooShort()
Text is too short
public
static textTooShort(int $minTextLength) : self
Parameters
- $minTextLength : int
Return values
selftitleTooLong()
Title is too long
public
static titleTooLong(int $maxTitleLength) : self
Parameters
- $maxTitleLength : int
Return values
selftitleTooShort()
Title is too short
public
static titleTooShort(int $minTitleLength) : self
Parameters
- $minTitleLength : int