On 26.06.2023 20:22, Ben Ramsey wrote:
I voted “no” on `IntlCalendar::set()` because it seems to me that `setDate()`
and `setDateTime()` could share the same signature if `$hour`, `$minute`, and
`$second` all default to zero, like this:
public function setDate(int $year, int $month, int $dayOfMonth, int $hour
= 0, int $minute = 0, int $second = 0): void {}
In the same way, with `IntlGregorianCalendar::__construct()`,
`createFromDate()` and `createFromDateTime()` could be combined as:
public static function createFromDate(int $year, int $month, int
$dayOfMonth, int $hour = 0, int $minute = 0, int $second = 0): void {}
I also voted No on IntlCalendar and IntlGregorianCalendar changes. The
proposed solution is not good enough.
IntlGregorianCalendar has already a static fromDateTime() method
inherited from IntlCalendar, so a new method is not needed, imo.
Also, setTime() method already exists (not the best name), so addition
of setDate() and setDateTime() will make it worse.
--
Aleksander Machniak
Kolab Groupware Developer [https://kolab.org]
Roundcube Webmail Developer [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php