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

Skip to content

[Validator] Convert objects to string in comparison validators #11559

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

Merged
merged 1 commit into from
Aug 13, 2014

Conversation

webmozart
Copy link
Contributor

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

In the latest merge from 2.3 into 2.4, the changes from 6cf5e08 in 2.4 got lost. This PR brings back these changes and backports them to 2.3.

The change is BC, because the former value true of the $prettyDateTime will be cast to 1, which corresponds to the PRETTY_DATE format constant.

@fabpot
Copy link
Member

fabpot commented Aug 6, 2014

👍

@webmozart
Copy link
Contributor Author

ping @stof @Tobion

{
if ($prettyDateTime && $value instanceof \DateTime) {
if (($format & self::PRETTY_DATE) && $value instanceof \DateTime) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this not also support http://php.net/manual/de/class.datetimeinterface.php from php 5.5

Copy link
Contributor

Choose a reason for hiding this comment

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

and DateInterval

Copy link
Member

Choose a reason for hiding this comment

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

adding the DateTimeInterface check is indeed a good idea (but not strictly required by this bugfix though, it is a separate one)

@stof
Copy link
Member

stof commented Aug 7, 2014

👍

@nicolas-grekas
Copy link
Member

Thanks @webmozart.

@nicolas-grekas nicolas-grekas merged commit 273671e into symfony:2.3 Aug 13, 2014
nicolas-grekas added a commit that referenced this pull request Aug 13, 2014
…tors (webmozart)

This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Convert objects to string in comparison validators

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

In the [latest merge from 2.3 into 2.4](/symfony/symfony/commit/3bed1b7988e94a897a64c6a2ad3bf70bde9005c1), the changes from 6cf5e08 in 2.4 got lost. This PR brings back these changes and backports them to 2.3.

The change is BC, because the former value `true` of the `$prettyDateTime` will be cast to `1`, which corresponds to the `PRETTY_DATE` format constant.

Commits
-------

273671e [Validator] Convert objects to string in comparison validators. Reapplies 6cf5e08
@webmozart webmozart deleted the fix-comp-to-string branch August 15, 2014 09:43
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.

5 participants