You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is easier and more type-safe to check dependencies between properties after object was fully mapped
publicfunctionvalidate(): void {
if (
$this->status === Status::PAID && $this->paidAt === null
|| $this->status === Status::UNPAID && $this->paidAt !== null
) {
throw ValueDoesNotMatch::createFromString('Payment date can only be set if and only if the status is `paid`.', Value::none());
}
}
Addition information
No response
Related issues
No response
The text was updated successfully, but these errors were encountered:
Description
It is easier and more type-safe to check dependencies between properties after object was fully mapped
Addition information
No response
Related issues
No response
The text was updated successfully, but these errors were encountered: