-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle][Validator] Remove deprecated ConstraintValidatorFactory #22887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tory $validators argument
I thought we would fully avoid storing instances from the container (i.e. remove the |
I think keeping this internal cache is cheap and still worth it, but no strong opinion on this. #22029 was motivated by the fact the memoization was useless when used with the symfony DI container and prevents from using properly non-shared services. BTW, this makes me think this implementation can be moved to the EDIT: The PSR-11 specifies:
WDYT? |
8000 fair enough to me! |
See #22905 about moving the class in the component (and keeping only one deprecation rather than the current three in 3.3) |
…o the component (ogizanagi) This PR was merged into the 3.3 branch. Discussion ---------- [FrameworkBundle][Validator] Move the PSR-11 factory to the component | Q | A | ------------- | --- | Branch? | 3.3 <!-- see comment below --> | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | yes <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #22887 (comment) <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A Instead of the 3 following deprecations: * The `ConstraintValidatorFactory::$validators` and `$container` properties have been deprecated and will be removed in 4.0. * Extending `ConstraintValidatorFactory` is deprecated and won't be supported in 4.0. * Passing an array of validators or validator aliases as the second argument of `ConstraintValidatorFactory::__construct()` is deprecated since 3.3 and will be removed in 4.0. Use the service locator instead. I'd suggest simply deprecating the FrameworkBundle's class in favor of using a new `ContainerConstraintValidatorFactory`. To me, there is no reason anyone using the validator component without the framework bundle cannot use this PSR-11 compliant implementation, nor I see a reason to make it final. Commits ------- 68c1917 [FrameworkBundle][Validator] Move the PSR-11 factory to the component
On hold (waiting for 3.3 branch to be merged in upper branches to get #22905). |
This can be closed |
Follows #22905