Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Composite Constraint not documented. #10381

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

Closed
buffalobuffalobuffalobuffalobuffalo opened this issue Sep 23, 2018 · 5 comments
Closed

Composite Constraint not documented. #10381

buffalobuffalobuffalobuffalobuffalo opened this issue Sep 23, 2018 · 5 comments
Milestone

Comments

@buffalobuffalobuffalobuffalobuffalo

There is a Composite Constraint

https://api.symfony.com/4.1/Symfony/Component/Validator/Constraints/Composite.html

but it completely lacks documentation. Does it allow for constructing logical alternative of other constraints? Like @Composite({@LessThan(4), @GreaterThan(8)})? Or is it designed for something entirely different?

@ro0NL
Copy link
Contributor

ro0NL commented Sep 27, 2018

The class is abstract... and a base for @Optional and @Required, explained here: https://symfony.com/doc/current/reference/constraints/Collection.html#required-and-optional-field-constraints

so yes, internal implementation detail to me :) but i'm not sure how it's implemented exactly, you might leverage it for your own "composites" i guess. AFAIK core only uses it for the Collection constraint.

@HeahDude
Copy link
Contributor

We could actually include a note for all composite constraints: All, Valid and Collection.
Because they do have a different behavior regarding validation groups.

@HeahDude HeahDude added this to the 2.8 milestone Sep 27, 2018
@OskarStark
Copy link
Contributor

Not sure it’s worth having it in the documentation 🤔

@xabbuh
Copy link
Member

xabbuh commented Jun 18, 2019

We should maybe rather think about marking it internal in the code instead.

@javiereguiluz
Copy link
Member

Closing for now in favor of the symfony/symfony#34830, which might mark this as internal. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants