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

[Clock] Add a polyfill for DateTimeImmutable::createFromTimestamp() #54442

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

derrabus
Copy link
Member

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues N/A
License MIT

This PR adds the new createFromTimestamp() method introduced in php/php-src#12413 to our DatePoint class. It comes with a polyfill implementation for PHP 8.2/8.3.

@derrabus
Copy link
Member Author

derrabus commented Mar 30, 2024

I ignored fabbot's proposed exception message formatting because I'd like to stay close to the exception message generated by the upstream implementation.

@derrabus derrabus force-pushed the feature/create-from-timestamp branch from 27a7fbb to 7cf2d71 Compare March 30, 2024 16:56
@derrabus derrabus force-pushed the feature/create-from-timestamp branch from 7cf2d71 to e2e7ffa Compare April 1, 2024 14:01
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Good catch, I missed this one :)

src/Symfony/Component/Clock/DatePoint.php Outdated Show resolved Hide resolved
src/Symfony/Component/Clock/DatePoint.php Outdated Show resolved Hide resolved
src/Symfony/Component/Clock/Tests/DatePointTest.php Outdated Show resolved Hide resolved
src/Symfony/Component/Clock/Tests/DatePointTest.php Outdated Show resolved Hide resolved
@javiereguiluz javiereguiluz added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Apr 2, 2024
@derrabus derrabus force-pushed the feature/create-from-timestamp branch 3 times, most recently from 7ca0fbd to cc1144d Compare April 2, 2024 09:34
@derrabus derrabus force-pushed the feature/create-from-timestamp branch from cc1144d to 9e48e0d Compare April 9, 2024 08:32
@derrabus
Copy link
Member Author

derrabus commented Apr 9, 2024

Ready

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit a8c43b6 into symfony:7.1 Apr 9, 2024
5 of 10 checks passed
@derrabus derrabus deleted the feature/create-from-timestamp branch April 9, 2024 09:01
@fabpot fabpot mentioned this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clock Feature ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants