Skip to content

ext/date: reduce duplication in __wakeup() methods #15791

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

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

DanielEScherzer
Copy link
Member

The only difference between DateTime::__wakeup() and DateTimeImmutable::__wakeup() is which class name is included in the error message if the initialization from the data fails. Factor out a helper method that is given the class name, and use it for both methods.

The only difference between `DateTime::__wakeup()` and
`DateTimeImmutable::__wakeup()` is which class name is included in the error
message if the initialization from the data fails. Factor out a helper method
that is given the class name, and use it for both methods.
Copy link
Member

@derickr derickr left a comment

Choose a reason for hiding this comment

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

LGTM

@DanielEScherzer
Copy link
Member Author

LGTM

@derickr would you mind merging this, given the approval and lack of objections?

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Looks like this was forgotten, sorry about that.
It looks good to me too, I'll merge it. Thanks!

@nielsdos nielsdos merged commit b5c3c2d into php:master Dec 6, 2024
10 checks passed
@DanielEScherzer DanielEScherzer deleted the patch-1 branch December 6, 2024 20:36
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.

3 participants