Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread G. P. B.
On Mon, 3 Jul 2023 at 01:11, Levi Morrison wrote: > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks to everyone

[PHP-DEV] RFC: Add Reflection*::hasAttribute()

2023-07-11 Thread Robin Chalas
Hi internals, It is common for attributes to be used as markers, and just like a marker interface has no methods, such attributes don’t have any parameter. Examples from Symfony: - #[Ignore] indicating that a property should be skipped in a serialization contextl - #[Exclude] telling the depende

[PHP-DEV] Reflection*::hasAttribute()

2023-07-11 Thread Robin Chalas
Hi internals, It is common attributes to be used as markers. Just like a marker interface with no methods, such attributes don’t have any parameter. Examples from Symfony: - #[Ignore] indicating that a property should be skipped in a serialization contextl - #[Exclude] telling the dependency in

Re: [PHP-DEV] Suggestion: Add optional suffix to tempnam()

2023-07-11 Thread Athos Ribeiro
On Sat, Apr 12, 2014 at 06:33:40AM +, Ferenc Kovacs wrote: On Sat, Apr 12, 2014 at 12:24 AM, Stefan Neufeind wrote: Hi, I'd like to pick up the original discussion about this patch here again. There have some updates on the github-pull. Maybe somebody could have a look into this, please?

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Jorg Sowa
> So, here's a crazy thought: why do inheritance, interfaces, and traits > need to be separate at all? > > At some level, they're all ways of composing a class with different > restrictions, e.g. inheritance requires a single parent, interfaces must be > abstract, traits don't interact with typing,

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Deleu
On Tue, Jul 11, 2023, 7:32 PM David Gebler wrote: > Looks - sadly to me - like this isn't going to pass. I don't have vote > karma and if I did it wouldn't make a difference to the outcome, but it > would be really good for those of us who can't vote on the feature to hear > from some of the peop

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread David Gebler
Looks - sadly to me - like this isn't going to pass. I don't have vote karma and if I did it wouldn't make a difference to the outcome, but it would be really good for those of us who can't vote on the feature to hear from some of the people who voted against it why they chose no. The feedback from

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread John Bafford
On Jul 11, 2023, at 13:42, Larry Garfield wrote: > > On Tue, Jul 11, 2023, at 5:28 PM, Robert Landers wrote: >> >> IMHO, using a shared base class reflects the inheritance better >> because they are siblings (at least these appear to be logical >> siblings out of context, IMHO) and should look l

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Dusk
On Jul 11, 2023, at 12:03, Peter Kokot wrote: > I really liked this idea actually but I'm still not so sure about it, > what would be the "right" approach. So, here's a crazy thought: why do inheritance, interfaces, and traits need to be separate at all? At some level, they're all ways of compo

Re: [PHP-DEV] Re: [VOTE] Interface Default Methods

2023-07-11 Thread Robert Landers
On Tue, Jul 11, 2023 at 9:04 PM Peter Kokot wrote: > On Tue, 11 Jul 2023 at 13:37, Levi Morrison > wrote: > > > > On Sun, Jul 2, 2023 at 6:11 PM Levi Morrison > wrote: > > > > > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > > > the past 6 days, and the feature freeze

Re: [PHP-DEV] Re: [VOTE] Interface Default Methods

2023-07-11 Thread Peter Kokot
On Tue, 11 Jul 2023 at 13:37, Levi Morrison wrote: > > On Sun, Jul 2, 2023 at 6:11 PM Levi Morrison wrote: > > > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > > the past 6 days, and the feature freeze deadline is fast approaching > > for PHP 8.3, so I'm moving this to v

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Larry Garfield
On Tue, Jul 11, 2023, at 5:28 PM, Robert Landers wrote: >> Real code I wrote a week ago (specifically, for a series of events in a >> domain model): >> >> https://gist.github.com/Crell/f5929e2ee44decd4e9353c41874f26c8 >> >> Two different interfaces, that I want to be able to check against, but the

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Robert Landers
> Real code I wrote a week ago (specifically, for a series of events in a > domain model): > > https://gist.github.com/Crell/f5929e2ee44decd4e9353c41874f26c8 > > Two different interfaces, that I want to be able to check against, but their > implementations are trivial. One of them is used in 2 c

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Larry Garfield
On Tue, Jul 11, 2023, at 3:16 PM, Robert Landers wrote: > On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield wrote: >> You have to check your vendor folder for an interface, or trait, or abstract >> class. That doesn't change anything. >> >> As noted, now consider a Baz interface. For interface-and

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Pierre
Le 11/07/2023 à 17:16, Robert Landers a écrit : On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield wrote: You have to check your vendor folder for an interface, or trait, or abstract class. That doesn't change anything. As noted, now consider a Baz interface. For interface-and-trait, you add 2

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Robert Landers
On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield wrote: > You have to check your vendor folder for an interface, or trait, or abstract > class. That doesn't change anything. > > As noted, now consider a Baz interface. For interface-and-trait, you add 2 > more definitions. For interface-with-def

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Larry Garfield
On Tue, Jul 11, 2023, at 2:04 PM, Robert Landers wrote: >> Not exactly, How you wanna solve by abstract class two interfaces >> which can be implemented using let's say two traits - let's say >> >> interface Foo { >> public function foo(): string; >> } >> trait HasFoo { >> public function f

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Robert Landers
> Not exactly, How you wanna solve by abstract class two interfaces > which can be implemented using let's say two traits - let's say > > interface Foo { > public function foo(): string; > } > trait HasFoo { > public function foo(): string { return 'foo'; } > } > interface Bar { > publi

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Deleu
On Tue, Jul 11, 2023 at 10:54 AM Michał Marcin Brzuchalski < michal.brzuchal...@gmail.com> wrote: > Hi Robert, > > wt., 11 lip 2023 o 14:54 Robert Landers > napisał(a): > >> ... >> Abstract classes solve this problem perfectly. It's part of the type >> system, it's type-hintable, it's mockable, a

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Michał Marcin Brzuchalski
Hi Robert, wt., 11 lip 2023 o 14:54 Robert Landers napisał(a): > ... > Abstract classes solve this problem perfectly. It's part of the type > system, it's type-hintable, it's mockable, and it's pretty easy to see > what inherits it as people who inherit it already know what the base > behavior w

Re: [PHP-DEV] [VOTE] Interface Default Methods

2023-07-11 Thread Robert Landers
> > a Trait was modified, what gets impacted? Is this not already the case for all tightly coupled code? This RFC proposes to make the least-coupled code in PHP more coupled, so soon, you'll be able to say the same for interfaces (if this passes). I don't understand this RFC. Symfony is a mess in

[PHP-DEV] Re: [VOTE] Interface Default Methods

2023-07-11 Thread Levi Morrison
On Sun, Jul 2, 2023 at 6:11 PM Levi Morrison wrote: > > Chatter on the [Interface Default Methods RFC][1] has been quiet for > the past 6 days, and the feature freeze deadline is fast approaching > for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks > as usual. > > Thanks to every