Skip to content
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

[Validator] Use comparison constraints as attributes #38382

Merged
merged 1 commit into from
Oct 4, 2020

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Oct 2, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? yes
Tickets #38096
License MIT
Doc PR TODO, let's add it to symfony/symfony-docs#14305

This PR enables all child classes of AbstractComparison to be used as attributes.

Some of those constraints used a trait called NumberConstraintTrait for a shared implementation. After my changes, that trait did not fit well anymore, so I've added a new ZeroComparisonConstraintTrait as a replacement. Although I don't expect NumberConstraintTrait to provide much value outside of the Symfony codebase, I think we cannot safely change it because it was not labelled as @internal. This is basically why I went for the deprecation.

@derrabus derrabus force-pushed the improvement/comparison-constraints branch from a960c30 to 0f36d4c Compare October 2, 2020 11:27
@derrabus derrabus changed the title [Validator] Use comparison constraints as attributes. [Validator] Use comparison constraints as attributes Oct 2, 2020
@nicolas-grekas nicolas-grekas added this to the next milestone Oct 2, 2020
@derrabus derrabus force-pushed the improvement/comparison-constraints branch from 0f36d4c to b5bdf82 Compare October 2, 2020 13:14
@fabpot
Copy link
Member

fabpot commented Oct 4, 2020

Thank you @derrabus.

@fabpot fabpot merged commit c91ad12 into symfony:master Oct 4, 2020
@derrabus derrabus deleted the improvement/comparison-constraints branch October 4, 2020 10:50
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
@fabpot fabpot mentioned this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants