Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions UPGRADE-8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ Uid
Validator
---------

* Change the default value of the `$requireTld` option of the `Url` constraint to `true`
* Add method `getGroupProvider()` to `ClassMetadataInterface`
* Replace `__sleep/wakeup()` by `__(un)serialize()` on `GenericMetadata` implementations
* Remove the `getRequiredOptions()` and `getDefaultOption()` methods from the `All`, `AtLeastOneOf`, `CardScheme`, `Collection`,
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Validator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
8.0
---

* Change the default value of the `$requireTld` option of the `Url` constraint to `true`
* Add method `getGroupProvider()` to `ClassMetadataInterface`
* Replace `__sleep/wakeup()` by `__(un)serialize()` on `GenericMetadata` implementations
* Remove the `getRequiredOptions()` and `getDefaultOption()` methods from the `All`, `AtLeastOneOf`, `CardScheme`, `Collection`,
Expand Down
6 changes: 1 addition & 5 deletions src/Symfony/Component/Validator/Constraints/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Url extends Constraint
public string $tldMessage = 'This URL is missing a top-level domain.';
public array $protocols = ['http', 'https'];
public bool $relativeProtocol = false;
public bool $requireTld = false;
public bool $requireTld = true;
/** @var callable|null */
public $normalizer;

Expand All @@ -61,10 +61,6 @@ public function __construct(

parent::__construct(null, $groups, $payload);

if (null === $requireTld) {
trigger_deprecation('symfony/validator', '7.1', 'Not passing a value for the "requireTld" option to the Url constraint is deprecated. Its default value will change to "true".');
}

$this->message = $message ?? $this->message;
$this->protocols = $protocols ?? $this->protocols;
$this->relativeProtocol = $relativeProtocol ?? $this->relativeProtocol;
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Validator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
],
"require": {
"php": ">=8.4",
"symfony/deprecation-contracts": "^2.5|^3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep the package installed forever

"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.0",
"symfony/translation-contracts": "^2.5|^3"
Expand Down
Loading