ldc-mesbr-app/src/Shared/DDD/Exceptions/UnknownCountryIsoCodeException.php

21 lines
464 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
2026-09-25 16:21:20 +02:00
namespace Shared\DDD\Exceptions;
2026-09-25 16:21:20 +02:00
use Shared\Enums\Country;
final class UnknownCountryIsoCodeException extends \DomainException
{
public static function fromIsoCode(string $isoCode): self
{
return new self("No country found for ISO code '{$isoCode}'");
}
public static function fromCountry(Country $country): self
{
return new self("No ISO code found for country '{$country->name}'");
}
}