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

Use DateTimeImmutable instead of DateTime. #775

Merged
merged 1 commit into from
Jan 3, 2019
Merged

Conversation

jwage
Copy link
Member

@jwage jwage commented Jan 3, 2019

Q A
Type improvement
BC Break no
Fixed issues #774

Summary

Related to conversation here #773 (comment)

@jwage jwage added this to the 2.0.0-beta2 milestone Jan 3, 2019
@jwage jwage self-assigned this Jan 3, 2019
@jwage jwage requested a review from Majkl578 January 3, 2019 01:20
@@ -41,7 +41,7 @@ public function write(
array $queriesByVersion,
?DateTimeInterface $now = null
) : bool {
$now = $now ?? new DateTime();
$now = $now ?? new DateTimeImmutable();
Copy link
Member

@SenseException SenseException Jan 3, 2019

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Issue logged here #776

@jwage jwage mentioned this pull request Jan 3, 2019
@jwage jwage merged commit 8bb3422 into master Jan 3, 2019
@jwage jwage deleted the use-date-time-immutable branch January 3, 2019 14:58
@jwage jwage modified the milestones: 2.0.0-beta2, 2.0.0-rc2 Jan 3, 2019
@jwage jwage removed the Enhancement label Jan 3, 2019
@jwage jwage modified the milestones: 2.0.0-rc2, 2.0.0 Jan 9, 2019
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.

4 participants