-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
ZonedDateTime::toDateTime and getDateTime conflict #47
Comments
IMO, the However I would keep the @BenMorel wdyt ? |
Some of |
In ZonedDateTime class we have two methods which looks almost the same, but different in return types:
public function toDateTime() : \DateTime
public function getDateTime() : LocalDateTime
To avoid misunderstanding and confuse I propose rename
toDateTime
totoNativeDateTime
.This approach could be used in other conversions in and from native types. For example:
Period::fromDateInterval
->Period::fromNativeDateInterval
Period::toDateInterval
->Period::toNativeDateInterval
LocalDateRange::toDatePeriod
->LocalDateRange::toNativeDatePeriod
TimeZone::fromDateTimeZone
->TimeZone::fromNativeDateTimeZone
etc..
Another variant is use Php prefix (
toDateTime
->toPhpDateTime
).The text was updated successfully, but these errors were encountered: