ext/date: Change return type to static - #23317
Conversation
ext/date: Fix DateTime return types for subclasses
8b1d131 to
6f487b3
Compare
There was a problem hiding this comment.
I agree with the changes. There's a new date api in the works, but these classes will be with us for quite a lot of time, so I think it makes sense to improve them, especially because most of them are only tentative types.
There's a few declared types which are demoted to tentative types: at first, I was worried about them that they broke BC... But then I realized that static can substitute the original class, so I think it's a good solution.
LGTM, but I'm not approving the PR, let's wait for @derickr's review. And @TimWolla may also have opinion.
|
You should re-run |
kocsismate
left a comment
There was a problem hiding this comment.
But I let Derick merge it when he looked at it. An UPGRADING note would probably be also useful, just like for the other recent return type changes.
| - Date: | ||
| . Added a new Time\Duration class. | ||
| RFC: https://wiki.php.net/rfc/duration_class | ||
| . The following DateTime, DateTimeImmutable, DateTimeZone, DateInterval, and DatePeriod methods now have tentative static return types: |
There was a problem hiding this comment.
this should go to the Changed Functions section
Use static return types for DateTime and related methods that preserve the called class.