From 828e76662ae3ccb0a0b2dee3ed2fb319e5df5490 Mon Sep 17 00:00:00 2001 From: Yannis Rizos Date: Tue, 21 Jan 2025 12:00:53 +0200 Subject: [PATCH] Url should extend NonEmptyString --- src/String/Url.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/String/Url.php b/src/String/Url.php index 526b0ff..ea95889 100644 --- a/src/String/Url.php +++ b/src/String/Url.php @@ -4,17 +4,14 @@ namespace Epignosis\Types\String; -use Epignosis\Types\AbstractType; use InvalidArgumentException; use const FILTER_NULL_ON_FAILURE; use const FILTER_SANITIZE_URL; use const FILTER_VALIDATE_URL; -class Url extends AbstractType +class Url extends NonEmptyString { - private string $value; - public function __construct(string $value) { /** @var string|null $value */ @@ -24,11 +21,6 @@ public function __construct(string $value) throw new InvalidArgumentException('Url is invalid'); } - $this->value = $value; - } - - final public function getValue(): string - { - return $this->value; + parent::__construct($value); } }