Implemented feature to optionally return an existing short url when all provided params match an existing one

This commit is contained in:
Alejandro Celaya
2019-02-03 09:40:32 +01:00
parent 772494f46f
commit c4fd8d5120
6 changed files with 160 additions and 42 deletions

View File

@@ -8,7 +8,7 @@ use function sprintf;
class InvalidUrlException extends RuntimeException
{
public static function fromUrl($url, Throwable $previous = null)
public static function fromUrl(string $url, Throwable $previous = null)
{
$code = $previous !== null ? $previous->getCode() : -1;
return new static(sprintf('Provided URL "%s" is not an existing and valid URL', $url), $code, $previous);