24 lines
603 B
PHP
24 lines
603 B
PHP
<?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');
|
|
}
|
|
}
|
|
}
|