-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH-11310: __debugInfo() does nothing on classes extending DateTime #12534
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
base: master
Are you sure you want to change the base?
Conversation
1ee23d1
to
46a5da4
Compare
…Time Makes the `__debugInfo` method work in classes that extend `DateTime` and `DateTimeImmutable`. * Implemented `__debugInfo` for `DateTime` and `DateTimeImmutable`. * Modified the `get_properties_for` handlers of `DateTime` and `DateTimeImmutable` to invoke `__debugInfo`.
46a5da4
to
54f607d
Compare
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.
Is this not needed for the other Date classes?
@@ -344,6 +344,9 @@ public function __serialize(): array {} | |||
|
|||
public function __unserialize(array $data): void {} | |||
|
|||
/** @tentative-return-type */ |
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.
Why does this have @tentative-return-type
?
Any update on this? |
@paulfedorow Could you please rebase + update your PR according to Derick's comment? Since it seems like a useful fix (btw the same inconsistency exists in other places), so I'll finish it if you don't have time for this anymore. |
} | ||
} | ||
|
||
class MyDateTimeZone extends DateTimeZone { |
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.
suggest adding a test case for MyDateTimeZone, otherwise why define the class at all?
Note that my patch at #16333 should fix this in a more general way |
I'm closing this in favor of the more general fix provided in #16333 |
Actually my comment may have been a bit premature, it seems that my more general approach may not be desirable |
Fixes GH-11310. Makes the
__debugInfo
method work in classes that extendDateTime
andDateTimeImmutable
.__debugInfo
forDateTime
andDateTimeImmutable
.get_properties_for
handlers ofDateTime
andDateTimeImmutable
to invoke__debugInfo
.