ldc-boutique-cnc-sable/domain/Exceptions/UnknownCountryIsoCodeException.php

21 lines
454 B
PHP
Raw Permalink Normal View History

2026-06-14 21:32:07 +02:00
<?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}'");
}
}