Replaced the use of EntityDoesNotExistException by ShorturlNotFoundException where applicable

This commit is contained in:
Alejandro Celaya
2019-11-25 18:54:25 +01:00
parent 310032e303
commit 0c5eec7e95
17 changed files with 60 additions and 109 deletions

View File

@@ -19,11 +19,7 @@ class NonUniqueSlugException extends InvalidArgumentException implements Problem
public static function fromSlug(string $slug, ?string $domain): self
{
$suffix = '';
if ($domain !== null) {
$suffix = sprintf(' for domain "%s"', $domain);
}
$suffix = $domain === null ? '' : sprintf(' for domain "%s"', $domain);
$e = new self(sprintf('Provided slug "%s" is already in use%s.', $slug, $suffix));
$e->detail = $e->getMessage();