-
Notifications
You must be signed in to change notification settings - Fork 4
Enhance ParseNodeFromStringTrait to handle fractional seconds in serialization #58
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
Conversation
baywet
left a comment
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.
Thanks for the contribution!
Can you please add unit tests to prevent future regressions?
|
@baywet I'm not completely au fait with unit tests, could you please ensure I've put them in correctly? The output was as follows: If so, then the requested changes have been made. |
baywet
left a comment
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.
Thank you for making the changes!
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Added regex to strip fractional seconds from interval strings.
|
@DanClarke-io there are linting issues now that I've rebased the PR, would you mind having a look at it please? |
Head branch was pushed to by a user without write access
baywet
left a comment
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.
Thank you for making the changes!
|
@DanClarke-io I think we're missing a null check so the risk of a null reference exception is mitigated, can you made another update please? |
…ngs, returning a zero interval test: add unit test for empty string returning zero DateInterval
Head branch was pushed to by a user without write access
|
Hi @baywet, I'm hoping this is correct, I usually work as a solo developer, so if I've put this in wrong, please do let me know so I can learn for the future :) |
baywet
left a comment
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.
No worries, I'm far from a PHP expert either. Last time I did production PHP, PHP 4 was "new" 😊
packages/abstractions/src/Serialization/ParseNodeFromStringTrait.php
Outdated
Show resolved
Hide resolved
packages/abstractions/src/Serialization/ParseNodeFromStringTrait.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Vincent Biret <vincentbiret@hotmail.com>
|
Ah I understand your requests now, thank you for the code review! |
baywet
left a comment
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.
Thank you for making the changes!
packages/abstractions/src/Serialization/ParseNodeFromStringTrait.php
Outdated
Show resolved
Hide resolved
…it.php Co-authored-by: Vincent Biret <vincentbiret@hotmail.com>
baywet
left a comment
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.
Thank you for making the changes!
|
@DanClarke-io sorry for the chaotic review here, one unit test is failing again |
Added regex to strip fractional seconds from interval strings.
This is caused when a value like PT33.48S is passed to the
parseDateIntervalFromString()function, and causes a fatal error: