Skip to content

Commit 0c91466

Browse files
committed
bug symfony#57894 [Validator] Add tldMessage parameter to Url constraint constructor (syjust)
This PR was submitted for the 7.2 branch but it was merged into the 7.1 branch instead. Discussion ---------- [Validator] Add `tldMessage` parameter to `Url` constraint constructor | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT according to the following documentation https://symfony.com/doc/current/reference/constraints/Url.html#tldmessage The Url Constraint does not allow to set tldMessage as the [following documentation](https://symfony.com/doc/current/reference/constraints/Url.html#tldmessage) explains. This is due to a missing Constructor Argument. This PR will fix that issue and let the Url Constraint works as described in the documentation. Commits ------- 8db4a92 [Validator] add tldMessage in URL constructor
2 parents 1a09bff + 8db4a92 commit 0c91466

File tree

1 file changed

+2
-0
lines changed
  • src/Symfony/Component/Validator/Constraints

1 file changed

+2
-0
lines changed

src/Symfony/Component/Validator/Constraints/Url.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function __construct(
5454
?array $groups = null,
5555
mixed $payload = null,
5656
?bool $requireTld = null,
57+
?string $tldMessage = null,
5758
) {
5859
parent::__construct($options, $groups, $payload);
5960

@@ -66,6 +67,7 @@ public function __construct(
6667
$this->relativeProtocol = $relativeProtocol ?? $this->relativeProtocol;
6768
$this->normalizer = $normalizer ?? $this->normalizer;
6869
$this->requireTld = $requireTld ?? $this->requireTld;
70+
$this->tldMessage = $tldMessage ?? $this->tldMessage;
6971

7072
if (null !== $this->normalizer && !\is_callable($this->normalizer)) {
7173
throw new InvalidArgumentException(sprintf('The "normalizer" option must be a valid callable ("%s" given).', get_debug_type($this->normalizer)));

0 commit comments

Comments
 (0)