2026-09-21 16:59:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-10-13 15:41:21 +02:00
|
|
|
namespace Domain\Models\ValueObjects;
|
2026-09-21 16:59:26 +02:00
|
|
|
|
2026-10-13 15:41:21 +02:00
|
|
|
final readonly class IncoCode
|
2026-09-21 16:59:26 +02:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws \DomainException
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(
|
|
|
|
|
public int $value,
|
|
|
|
|
) {
|
|
|
|
|
if ($this->value <= 0) {
|
|
|
|
|
throw new \DomainException('Inco Code must be a positive integer.');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|