10000 [Validator] convert object to string if possible instead of using var_export directly by bes89 · Pull Request #9036 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] convert object to string if possible instead of using var_export directly #9036

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 2 commits into from
Closed

[Validator] convert object to string if possible instead of using var_export directly #9036

wants to merge 2 commits into from

Conversation

bes89
Copy link
Contributor
@bes89 bes89 commented Sep 14, 2013
Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

…_export directly

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -
@jakzal
Copy link
Contributor
jakzal commented Sep 14, 2013

I'm not sure if that's what we need, but if we do you'll have to write a test covering this case.

@bes89
Copy link
Contributor Author
bes89 commented Sep 14, 2013

done.

@jakzal that's what we need! suppose you are using the form view transformer which transforms string intput to objects and you want to validate these input by using the comparison validators
it makes the comparison validator classes more flexible.

my use case was:
transform string input to a datetime object but if the input isn't valid the validator shows the date in english format. but what about other datetime formats? so, i extended the datetime object and added a setter for format and a tostring method.

@bes89
Copy link
Contributor Author
bes89 commented Sep 15, 2013

@fabpot fabpot closed this in d3ca145 Sep 16, 2013
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.

2 participants
0