ldc-boutique-cnc-sable/domain/Models/ValueObjects/AttachedFile.php

25 lines
603 B
PHP
Raw Permalink Normal View History

2026-06-14 21:32:07 +02:00
<?php
declare(strict_types=1);
namespace Domain\Models\ValueObjects;
final readonly class AttachedFile
{
public function __construct(
public string $path,
public string $originalName,
public string $mimeType
) {
if (trim($path) === '') {
throw new \DomainException('path cannot be empty');
}
if (trim($originalName) === '') {
throw new \DomainException('originalName cannot be empty');
}
if (trim($mimeType) === '') {
throw new \DomainException('mimeType cannot be empty');
}
}
}