-
Notifications
You must be signed in to change notification settings - Fork 63
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
Change only Chronos to extend DateTimeImmutable once again #417
Conversation
6d236a3
to
d3582ca
Compare
d3582ca
to
8f86c7d
Compare
Removed unnecessary Chronos type declaration from formatter methods. |
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.
Would we want to release this as 3.1.0?
@@ -998,7 +970,7 @@ public function format(string $format): string | |||
*/ | |||
public function getOffset(): int | |||
{ | |||
return $this->native->getOffset(); | |||
return parent::getOffset(); |
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 there much point in retaining methods like these if they only call parent?
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.
Only if we want to ensure the type hints are available. I think most IDE's can figure this class out though.
I was thinking about commenting out the ones we don't need to wrap for types, but not delete them. We never know what PHP 9 will bring.
Up to you. It would make it possible for people to transition without forcing it on them, but we do want this to be official. However, the only feedback we've seen was initially negative (or at least not positive) to not extending DateTimeImmutable. CakePHP 5 deps need to be updated to only support this. |
8f86c7d
to
a767bc9
Compare
a767bc9
to
6db2131
Compare
public function toNative(): DateTimeImmutable | ||
{ | ||
return $this->native; | ||
} |
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.
This method was REMOVED in a BUGFIX release?! This change would have broken production releases if our automated testing didn't catch it.
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.
The removal was a mistake, we'll get that fixed.
The original reasons for this change are described here: #410 (comment)