-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Use DateTimeImmutable instead of DateTime. #775
Conversation
@@ -41,7 +41,7 @@ public function write( | |||
array $queriesByVersion, | |||
?DateTimeInterface $now = null | |||
) : bool { | |||
$now = $now ?? new DateTime(); | |||
$now = $now ?? new DateTimeImmutable(); |
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.
Does it make sense to use new DateTimeImmutable('now', new DateTimeZone('UTC'));
like above in Configuration.php? Can a timezone with daylight saving time be an issue here?
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.
Probably should be changed to match elsewhere. Practically I don't think it would ever cause an issue though.
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 think it needs good timing. But this is for another time and PR to find out.
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 will send another PR to fix that.
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.
Issue logged here #776
Summary
Related to conversation here #773 (comment)