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

#720 - Adding support for DateInterval deserialization #721

Merged
merged 5 commits into from
Mar 9, 2017

Conversation

c0ntax
Copy link
Contributor

@c0ntax c0ntax commented Mar 3, 2017

Added in DateInterval deserialization and associated unit test

Fixes #720

@goetas goetas self-assigned this Mar 6, 2017
try {
$dateInterval = new \DateInterval($data);
} catch (\Exception $e) {
throw new RuntimeException(sprintf('Invalid dateinterval "%s", expected ISO 8601 format', $data));
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about adding the previous exception ($e) as third argument of RuntimeException ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just copying the one example of catching and rethrowing an exception within the project to keep things consistent, but I'm happy to add that as a 3rd param. It makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added rethrow of exception

@goetas goetas added this to the v1.6 milestone Mar 6, 2017
@goetas goetas merged commit 7c0ed4e into schmittjoh:master Mar 9, 2017
@goetas
Copy link
Collaborator

goetas commented Mar 9, 2017

@c0ntax thanks!

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