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

Skip to content

[Validator] Support for DateTimeImmutable #18759

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
wants to merge 3 commits into from
Closed

[Validator] Support for DateTimeImmutable #18759

wants to merge 3 commits into from

Conversation

krzysiekpiasecki
Copy link
Contributor

@krzysiekpiasecki krzysiekpiasecki commented May 12, 2016

Q A
Branch? 3.0
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18752
License MIT
Doc PR

When validating with DateTime constraint UnexpectedTypeException is thrown for DateTimeImmutable instances.

Why PR?

  • DateTimeImmutable behaves like a DateTime. Both implements the same interface DateTimeInterface.
  • DateTimeInterface cannot be implemented by the client.

@krzysiekpiasecki krzysiekpiasecki changed the title Support for DateTimeImmutable [Component] [Validator] Support for DateTimeImmutable May 12, 2016
@javiereguiluz javiereguiluz changed the title [Component] [Validator] Support for DateTimeImmutable [Validator] Support for DateTimeImmutable May 12, 2016
@@ -43,6 +43,16 @@ public function testDateTimeClassIsValid()
}

/**
* @requires PHP 5.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed as Symfony 3.0 already requires PHP 5.5.9

@dunglas
Copy link
Member

dunglas commented May 16, 2016

👍

Status: reviewed

Travis error looks unrelated

@xabbuh
Copy link
Member

xabbuh commented May 16, 2016

👍

@nicolas-grekas
Copy link
Member

Thank you @krzysiekpiasecki.

nicolas-grekas added a commit that referenced this pull request May 19, 2016
This PR was squashed before being merged into the 3.0 branch (closes #18759).

Discussion
----------

[Validator] Support for DateTimeImmutable

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

When validating with DateTime constraint UnexpectedTypeException is thrown for DateTimeImmutable instances.

Why PR?
- DateTimeImmutable behaves like a DateTime. Both implements the same interface DateTimeInterface.
- DateTimeInterface cannot be implemented by the client.

Commits
-------

f49659f [Validator] Support for DateTimeImmutable
@fabpot fabpot mentioned this pull request May 26, 2016
@fabpot fabpot mentioned this pull request Jun 6, 2016
fabpot added a commit that referenced this pull request Jan 2, 2017
…mes (xabbuh)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Validator] support DateTimeInterface instances for times

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

The same has already been done for the `Date` and `DateTime` constraints in #18759.

Commits
-------

1fa9276 support DateTimeInterface instances for times
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.

6 participants