ldc-mesbr-app/src/Domain/Models/ValueObjects/IncoCode.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.');
}
}
}