18 lines
335 B
PHP
18 lines
335 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domain\Models\ValueObjects;
|
|
|
|
final readonly class CouponName
|
|
{
|
|
public function __construct(
|
|
public string $value,
|
|
) {
|
|
$trimmed = mb_trim($value);
|
|
|
|
if ($trimmed === '') {
|
|
throw new \DomainException('Coupon name cannot be empty.');
|
|
}
|
|
}
|
|
}
|