diff --git a/module/Core/src/Entity/ShortUrl.php b/module/Core/src/Entity/ShortUrl.php index 38fc5911..0f7ea621 100644 --- a/module/Core/src/Entity/ShortUrl.php +++ b/module/Core/src/Entity/ShortUrl.php @@ -90,7 +90,7 @@ class ShortUrl extends AbstractEntity implements \JsonSerializable */ public function setOriginalUrl(string $originalUrl) { - $this->originalUrl = (string) $originalUrl; + $this->originalUrl = $originalUrl; return $this; } diff --git a/module/Core/src/Service/UrlShortener.php b/module/Core/src/Service/UrlShortener.php index 4aecade9..a14665e4 100644 --- a/module/Core/src/Service/UrlShortener.php +++ b/module/Core/src/Service/UrlShortener.php @@ -80,7 +80,7 @@ class UrlShortener implements UrlShortenerInterface // First, create the short URL with an empty short code $shortUrl = new ShortUrl(); - $shortUrl->setOriginalUrl($url); + $shortUrl->setOriginalUrl((string) $url); $this->em->persist($shortUrl); $this->em->flush();