Added option to provide custom slug when creating a short url

This commit is contained in:
Alejandro Celaya
2017-10-21 17:18:57 +02:00
parent 0232f68b91
commit 1f7a94794d
5 changed files with 118 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Exception;
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
class NonUniqueSlugException extends InvalidArgumentException
{
public static function fromSlug(string $slug): self
{
return new self(sprintf('Provided slug "%s" is not unique.', $slug));
}
}