Extract logic to match IP address against list of groups

This commit is contained in:
Alejandro Celaya
2024-07-06 10:12:05 +02:00
parent b6b2530cb6
commit 8d90661d0a
4 changed files with 103 additions and 43 deletions

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Exception;
use function sprintf;
class InvalidIpFormatException extends RuntimeException implements ExceptionInterface
{
public static function fromInvalidIp(string $ipAddress): self
{
return new self(sprintf('Provided IP %s does not have the right format. Expected X.X.X.X', $ipAddress));
}
}