19 lines
352 B
PHP
19 lines
352 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domain\Models\ValueObjects;
|
|
|
|
final readonly class IncoCode
|
|
{
|
|
/**
|
|
* @throws \DomainException
|
|
*/
|
|
public function __construct(
|
|
public int $value,
|
|
) {
|
|
if ($this->value <= 0) {
|
|
throw new \DomainException('Inco Code must be a positive integer.');
|
|
}
|
|
}
|
|
}
|