19 lines
345 B
PHP
19 lines
345 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Domain\Models\ValueObjects\Actor;
|
||
|
|
|
||
|
|
final readonly class ActorDisplayName
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
public string $value,
|
||
|
|
) {
|
||
|
|
$trimmed = trim($value);
|
||
|
|
|
||
|
|
if ($trimmed === '') {
|
||
|
|
throw new \DomainException('Display name cannot be empty.');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|