28 lines
724 B
PHP
28 lines
724 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domain\Events\Dto;
|
|
|
|
final readonly class OrderPlacedShop
|
|
{
|
|
public function __construct(
|
|
public string $name,
|
|
public string $address,
|
|
public string $postcode,
|
|
public string $city,
|
|
) {
|
|
if (empty(trim($name))) {
|
|
throw new \DomainException('Shop name is required');
|
|
}
|
|
if (empty(trim($address))) {
|
|
throw new \DomainException('Shop address is required');
|
|
}
|
|
if (empty(trim($postcode))) {
|
|
throw new \DomainException('Shop postcode is required');
|
|
}
|
|
if (empty(trim($city))) {
|
|
throw new \DomainException('Shop city is required');
|
|
}
|
|
}
|
|
}
|