Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-24 Thread Rowan Tommins
On 19/01/2023 19:25, Ilija Tovilo wrote: This has been suggested before and we're consider it. Here's a comparable PHP implementation. https://3v4l.org/6Ua8t I'm confused what all the complexity here is doing. I get the same result for that example with this one liner, using a tightly limite

Re: [PHP-DEV] [RFC] [Vote] Readonly amendments

2023-01-24 Thread Deleu
> > > > Mocking > > > > This isn't a terribly compelling argument. Readonly classes are typically > value objects; it's rare that you will mock them as they will be used as > messages or results, and you'll end up doing assertions against them — not > mocking them. > > Anything else it would enable

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-24 Thread Clint Priest
On 1/19/2023 12:40 PM, Marco Pivetta wrote: Not just that, but `debug_backtrace()` already exists for that purpose. I have use debug_backtrace() exactly for this purpose in the past. It was to make a protected property readable/writable, but only by certain "friend classes." It's pretty tr

Re: [PHP-DEV] [RFC] [Vote] Readonly amendments

2023-01-24 Thread Christian Schneider
Am 24.01.2023 um 09:55 schrieb Máté Kocsis : > We've just opened the vote for the "Readonly amendments" RFC, which is > going to be open for 2 weeks (until 2023-02-07). > > Link: https://wiki.php.net/rfc/readonly_amendments > Discussion: https://externals.io/message/119007 I like the idea of more

Re: [PHP-DEV] Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically

2023-01-24 Thread Robert Landers
On Tue, Jan 24, 2023 at 12:06 PM Ollie Read wrote: > > You're absolutely correct, the problem I was trying to solve was the ability > to reference a method without throwing around magic strings, apologies if > that wasn't clear. > > The whole idea, or rather, need/want for it came about because

Re: [PHP-DEV] [RFC] Pass Scope to Magic Accessors

2023-01-24 Thread Dan Ackroyd
On Mon, 23 Jan 2023 at 16:27, Nicolas Grekas wrote: > > Legit concerns. I'm going to prepare a more extensive use case so the > motivations of RFC become more obvious. > > I'll get back on this thread when ready. Stay tuned :) Please can you look at implementing it as a function, that returns a m

Re: [PHP-DEV] Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically

2023-01-24 Thread Ollie Read
You're absolutely correct, the problem I was trying to solve was the ability to reference a method without throwing around magic strings, apologies if that wasn't clear. The whole idea, or rather, need/want for it came about because of time spent with Javas functional side, though I understand

Re: [PHP-DEV] Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically

2023-01-24 Thread Dan Ackroyd
On Mon, 23 Jan 2023 at 23:03, Larry Garfield wrote: > > So you're saying that would generate a callable equivalent to: > > $fnMethod = fn (Zok $zok, string $zebranky): Frungy => $zok->Pik($zebranky); Yes. > (We're also now rather far afield from the OP's request, I think.) Well, yeah. Deliberat

[PHP-DEV] [RFC] [Vote] Readonly amendments

2023-01-24 Thread Máté Kocsis
Hi Everyone, We've just opened the vote for the "Readonly amendments" RFC, which is going to be open for 2 weeks (until 2023-02-07). Link: https://wiki.php.net/rfc/readonly_amendments Discussion: https://externals.io/message/119007 Regards, Máté Kocsis