-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
RequiredValidator missing from 3.4.40 release #36637
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
Comments
The |
Actually, this is how we use it: $validator = Validation::createValidator();
$constraints = new Constraints\Collection([
'theField' => [
new Constraints\Required(),
new Constraints\NotBlank(),
],
]); Correct us if we are wrong.. |
Correct usage of the Collection constraints looks like that AFAICT:
Also note that fields for which you pass an array of constraints instead of an Optional or Required object get it wrapped in a Required automatically. So your code is equivalent to using a standard Required constraint inside a required field. |
Thank you @stof for your explanation. There is no |
see also #36723 |
see #36894 |
…tional) constraints (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [Validator] never directly validate Existence (Required/Optional) constraints | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #36637 #36723 | License | MIT | Doc PR | Using `Optional` or `Required` like "regular" constraints does not make any sense, but doing so didn't break before #36365. I suggest to ignore them for now and deprecate using them outside the `Collection` constraint in 5.2. Commits ------- d333aae never directly validate Existence (Required/Optional) constraints
Symfony version(s) affected: 3.4.40
Description
The RequiredValidator is missing from Symfony\Component\Validator\Constraints and breaks the usage of
new Constraints\Required()
The text was updated successfully, but these errors were encountered: