8000 bug #31908 [Validator] fix deprecation layer of ValidatorBuilder (nic… · symfony/symfony@d98dd9b · GitHub
[go: up one dir, main page]

Skip to content

Commit d98dd9b

Browse files
bug #31908 [Validator] fix deprecation layer of ValidatorBuilder (nicolas-grekas)
This PR was merged into the 4.2 branch. Discussion ---------- [Validator] fix deprecation layer of ValidatorBuilder | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As identified in #31898: we cannot remove the interface and make the replacing implementation final in the same run. This PR turns only setTranslator() final to allow changing its type hint in 5.0. Commits ------- 154ce81 [Validator] fix deprecation layer of ValidatorBuilder
2 parents 9c37d18 + 154ce81 commit d98dd9b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

UPGRADE-4.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Validator
385385
* The `symfony/translation` dependency has been removed - run `composer require symfony/translation` if you need the component
386386
* The `checkMX` and `checkHost` options of the `Email` constraint are deprecated
387387
* The component is now decoupled from `symfony/translation` and uses `Symfony\Contracts\Translation\TranslatorInterface` instead
388-
* The `ValidatorBuilderInterface` has been deprecated and `ValidatorBuilder` made final
388+
* The `ValidatorBuilderInterface` has been deprecated and `ValidatorBuilder::setTranslator()` has been made final
389389
* Deprecated validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator`. Use `Type` instead or remove the constraint if the underlying model is type hinted to `\DateTimeInterface` already.
390390
* Using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl` is deprecated
391391
* Using the `Email` constraint in strict mode without `egulias/email-validator` is deprecated

UPGRADE-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Validator
259259
* Calling `EmailValidator::__construct()` method with a boolean parameter has been removed, use `EmailValidator("strict")` instead.
260260
* Removed the `checkDNS` and `dnsMessage` options from the `Url` constraint.
261261
* The component is now decoupled from `symfony/translation` and uses `Symfony\Contracts\Translation\TranslatorInterface` instead
262-
* The `ValidatorBuilderInterface` has been removed and `ValidatorBuilder` is now final
262+
* The `ValidatorBuilderInterface` has been removed
263263
* Removed support for validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator`. Use `Type` instead or remove the constraint if the underlying model is type hinted to `\DateTimeInterface` already.
264264
* The `symfony/intl` component is now required for using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints
265265
* The `egulias/email-validator` component is now required for using the `Email` constraint in strict mode

src/Symfony/Component/Validator/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CHANGELOG
99
* added `DivisibleBy` constraint
1010
* decoupled from `symfony/translation` by using `Symfony\Contracts\Translation\TranslatorInterface`
1111
* deprecated `ValidatorBuilderInterface`
12-
* made `ValidatorBuilder` final
12+
* made `ValidatorBuilder::setTranslator()` final
1313
* marked `format` the default option in `DateTime` constraint
1414
* deprecated validating instances of `\DateTimeInterface` in `DateTimeValidator`, `DateValidator` and `TimeValidator`.
1515
* deprecated using the `Bic`, `Country`, `Currency`, `Language` and `Locale` constraints without `symfony/intl`

src/Symfony/Component/Validator/ValidatorBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
* The default implementation of {@link ValidatorBuilderInterface}.
3939
*
4040
* @author Bernhard Schussek <bschussek@gmail.com>
41-
*
42-
* @final since Symfony 4.2
4341
*/
4442
class ValidatorBuilder implements ValidatorBuilderInterface
4543
{
@@ -255,6 +253,8 @@ public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterfac
255253

256254
/**
257255
* {@inheritdoc}
256+
*
257+
* @final since Symfony 4.2
258258
*/
259259
public function setTranslator(LegacyTranslatorInterface $translator)
260260
{

0 commit comments

Comments
 (0)
0