refactor: add custom Exception class

This commit is contained in:
Maël Gangloff
2025-10-07 15:55:17 +02:00
parent 79589e63eb
commit ea1df9d97a
10 changed files with 109 additions and 37 deletions

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Exception;
class MalformedDomainException extends \Exception
{
public static function fromDomain(string $ldhName): MalformedDomainException
{
return new MalformedDomainException("Domain name ($ldhName) must contain at least one dot");
}
}