Re: [RFC] [Vote] Deprecate functions with overloaded signatures

From: Date: Tue, 27 Jun 2023 05:44:23 +0000
Subject: Re: [RFC] [Vote] Deprecate functions with overloaded signatures
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-120689@lists.php.net to get a copy of this message
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

« previous php.internals (#120689) next »