From 2479c8b3ccdd1c12e8e1422ec661e41633c880f8 Mon Sep 17 00:00:00 2001 From: "A. Pauly" Date: Sun, 23 Jun 2024 19:10:33 +0200 Subject: [PATCH] fix: add missing construct parameter to override tldMessage property --- Constraints/Url.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Constraints/Url.php b/Constraints/Url.php index 9481f939..80bcba99 100644 --- a/Constraints/Url.php +++ b/Constraints/Url.php @@ -44,6 +44,7 @@ class Url extends Constraint * @param bool|null $relativeProtocol Whether to accept URL without the protocol (i.e. //example.com) (defaults to false) * @param string[]|null $groups * @param bool|null $requireTld Whether to require the URL to include a top-level domain (defaults to false) + * @param string|null $tldMessage Override the default TLD error message */ public function __construct( ?array $options = null, @@ -54,6 +55,7 @@ public function __construct( ?array $groups = null, mixed $payload = null, ?bool $requireTld = null, + ?string $tldMessage = null, ) { parent::__construct($options, $groups, $payload); @@ -66,6 +68,7 @@ public function __construct( $this->relativeProtocol = $relativeProtocol ?? $this->relativeProtocol; $this->normalizer = $normalizer ?? $this->normalizer; $this->requireTld = $requireTld ?? $this->requireTld; + $this->tldMessage = $tldMessage ?? $this->tldMessage; if (null !== $this->normalizer && !\is_callable($this->normalizer)) { throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer)));