ldc-boutique-cnc-sable/domain/Exceptions/UnknownCountryIsoCodeException.php
2026-10-27 09:58:12 +01:00

20 lines
454 B
PHP

<?php
declare(strict_types=1);
namespace Domain\Exceptions;
use Domain\Enums\Country;
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}'");
}
}