21 lines
460 B
PHP
21 lines
460 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Domain\Models\ValueObjects;
|
||
|
|
|
||
|
|
use Webmozart\Assert\Assert;
|
||
|
|
|
||
|
|
final readonly class SeoMetadata
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
public string $title,
|
||
|
|
public string $description,
|
||
|
|
) {
|
||
|
|
Assert::stringNotEmpty(trim($this->title));
|
||
|
|
Assert::maxLength($this->title, 255);
|
||
|
|
Assert::stringNotEmpty(trim($this->description));
|
||
|
|
Assert::maxLength($this->description, 500);
|
||
|
|
}
|
||
|
|
}
|