On Tue, Feb 18, 2025, at 2:00 AM, Rowan Tommins [IMSoP] wrote:
> On 17 February 2025 14:39:42 GMT, Viktor Khramov
> wrote:
>>Hi!
>>
>>The point is here:
>>https://gist.github.com/vhood/665418835e65be26d5a818fded92ab75
>
>
>>Static functions look awful and break the object's API.
>
> Personally, I
On Tue, Feb 18, 2025 at 10:27 AM Viktor Khramov
wrote:
> Decision::createFromId($uuid, $comment);
> Decision::createFromMail($subject, $body);
> Decision::createFromSome($a, $b, $c);
> Decision::createFromAnother($a);
>
> This doesn't look like constructors. It will be hard to read the
> class, i
Hi
Am 2025-02-18 09:00, schrieb Rowan Tommins [IMSoP]:
Personally, I think quite the opposite: named constructors make a lot
more sense than type-based overloads. For instance, you might have both
createFromJson and createFromYaml; their inputs are both going to be
"string" as far as the type
On Tue, 18 Feb 2025 at 12:45, Sebastian Bergmann wrote:
> Am 18.02.2025 um 09:00 schrieb Rowan Tommins [IMSoP]:
> > named constructors make a lot more sense than type-based overloads
>
> +1
>
Hi, Viktor.
I agree with others that named static constructors are much better
than overloading
of the
Am 18.02.2025 um 09:00 schrieb Rowan Tommins [IMSoP]:
named constructors make a lot more sense than type-based overloads
+1
Decision::createFromId($uuid, $comment);
Decision::createFromMail($subject, $body);
Decision::createFromSome($a, $b, $c);
Decision::createFromAnother($a);
This doesn't look like constructors. It will be hard to read the
class, it will take time to come up with a name, it's not right. I
have differ
On 17 February 2025 14:39:42 GMT, Viktor Khramov
wrote:
>Hi!
>
>The point is here:
>https://gist.github.com/vhood/665418835e65be26d5a818fded92ab75
>Static functions look awful and break the object's API.
Personally, I think quite the opposite: named constructors make a lot more
sense than
Hi Viktor,
On Mon, Feb 17, 2025 at 4:42 PM Viktor Khramov
wrote:
> Hi!
>
> The point is here:
> https://gist.github.com/vhood/665418835e65be26d5a818fded92ab75
>
> Is it possible? May I create an RFC for this?
>
Already possible like this:
class Decision
{
#[Main]
public function __cons
Hi
Related to overloading, that is binding to the correct function in
Java/C#
at compile time, and IMO is not matching with the dynamic nature of
PHP.
Indeed. See: https://github.com/php/php-src/issues/17813
Best regards
Tim Düsterhus