-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Conversation
try { | ||
$dateInterval = new \DateInterval($data); | ||
} catch (\Exception $e) { | ||
throw new RuntimeException(sprintf('Invalid dateinterval "%s", expected ISO 8601 format', $data)); |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added rethrow of exception
@c0ntax thanks! |
Added in DateInterval deserialization and associated unit test
Fixes #720