-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] deprecate handling options in the base Constraint class #60801
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
base: 7.4
Are you sure you want to change the base?
Conversation
xabbuh
commented
Jun 16, 2025
Q | A |
---|---|
Branch? | 7.4 |
Bug fix? | no |
New feature? | no |
Deprecations? | yes |
Issues | Fix #60029 |
License | MIT |
src/Symfony/Component/Validator/Attribute/InitializesOptions.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Tests/Constraints/AtLeastOneOfValidatorTest.php
Outdated
Show resolved
Hide resolved
e6f87d8
to
b08f6af
Compare
9bdaa28
to
fe67424
Compare
I think this is now ready. I have also added some more details to the changelog/upgrade files to explain how to update custom constraints around the several deprecations. |
UPGRADE-7.4.md
Outdated
Before: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before: | |
**Before** |
that's how we use it in the 8.0 upgrade file, not a blocker
class CustomConstraint extends Constraint | ||
{ | ||
public $option1; | ||
public $option2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose these are not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are because these properties are populated by the parent normalizeOptions()
method if I don't misunderstand what you mean (basically the statement $knownOptions = get_class_vars(static::class);
is built on top of the existence of the properties).