-
-
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. |
|
||
public function __construct($option1 = null, $option2 = null) | ||
{ | ||
parent::__construct(); |
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 suggest showing passing the groups to the parent in the After code (as the Before code passing the array of options supports groups
in the options)
public $option1; | ||
public $option2; | ||
|
||
public function __construct($option1 = null, $option2 = null) |
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.
this missing the HasNamedArgument
attribute that is required to make the constraint compatible with XML and Yaml file loaders (for attributes, it depends on how the constructor is used so the component attribute is not necessary, but it does not hurt and the changelog should support both cases)
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.
this also applies to the component changelog of course.