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] Support \DateInterval in comparison constraints #33401

Open
wants to merge 1 commit into
base: 4.4
from

Conversation

@fancyweb
Copy link
Contributor

commented Aug 30, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR TODO

That feature allows to use the Range and all comparisons constraints on \DateInterval values.

/**
 * @GreaterThan("+30 seconds")
 */
private $foo;

/**
 * @Range(min="6 months", max="10 years")
 */
private $bar;

TODO :

  • Update CHANGELOG
  • Test ConstraintValidator::formatValue() with PRETTY_DATE_INTERVAL
  • Test ComparisonValidatorDateIntervalHelper
  • Check DivisibleBy - this constraint is a comparison and there is no test with dates, so I guess a proper exception needs to be thrown. - see #33435

Edit : waiting for other related PRs to be treated before resynchronizing everything on this one.

@fancyweb fancyweb force-pushed the fancyweb:validator-compare-date-interval branch from 9f86290 to 2554641 Aug 30, 2019

@yceruto yceruto added this to the next milestone Aug 30, 2019

@fancyweb fancyweb changed the title [Validator] Support \DateInterval in comparison constraints [WIP][Validator] Support \DateInterval in comparison constraints Sep 3, 2019

fabpot added a commit that referenced this pull request Sep 3, 2019
minor #33434 [Validator] Add ConstraintValidator::formatValue() tests…
… (fancyweb)

This PR was squashed before being merged into the 3.4 branch (closes #33434).

Discussion
----------

[Validator] Add ConstraintValidator::formatValue() tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

So #33401 tests can be built on top of this.

Commits
-------

b688aa3 [Validator] Add ConstraintValidator::formatValue() tests
symfony-splitter pushed a commit to symfony/validator that referenced this pull request Sep 3, 2019
minor #33434 [Validator] Add ConstraintValidator::formatValue() tests…
… (fancyweb)

This PR was squashed before being merged into the 3.4 branch (closes #33434).

Discussion
----------

[Validator] Add ConstraintValidator::formatValue() tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

So symfony/symfony#33401 tests can be built on top of this.

Commits
-------

b688aa31ec [Validator] Add ConstraintValidator::formatValue() tests

@fancyweb fancyweb force-pushed the fancyweb:validator-compare-date-interval branch 2 times, most recently from af34089 to 9a19842 Sep 4, 2019

@fancyweb fancyweb changed the title [WIP][Validator] Support \DateInterval in comparison constraints [Validator] Support \DateInterval in comparison constraints Sep 4, 2019

@fancyweb fancyweb force-pushed the fancyweb:validator-compare-date-interval branch from 9a19842 to 1b0654a Sep 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.