Re: [PHP-DEV] Declaration-aware attributes

2023-05-31 Thread Benjamin Außenhofer
On Tue, May 30, 2023 at 2:49 AM Andreas Hennings wrote: > Hello internals, > I am picking up an idea that was mentioned by Benjamin Eberlei in the past. > https://externals.io/message/110217#110395 > (we probably had the idea independently, but Benjamin's is the first > post where I see it mentio

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Andreas Hennings
On Tue, 30 May 2023 at 22:45, Larry Garfield wrote: > > On Tue, May 30, 2023, at 7:34 PM, Andreas Hennings wrote: > > On Tue, 30 May 2023 at 19:12, Larry Garfield wrote: > >> > >> I've run into this issue in my attribute library as well > >> (https://github.com/Crell/AttributeUtils). What I do

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Larry Garfield
On Tue, May 30, 2023, at 7:34 PM, Andreas Hennings wrote: > On Tue, 30 May 2023 at 19:12, Larry Garfield wrote: >> >> I've run into this issue in my attribute library as well >> (https://github.com/Crell/AttributeUtils). What I do there is allow >> attributes to opt-in to a callback method via

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Andreas Hennings
On Tue, 30 May 2023 at 19:12, Larry Garfield wrote: > > I've run into this issue in my attribute library as well > (https://github.com/Crell/AttributeUtils). What I do there is allow > attributes to opt-in to a callback method via interface. For example: > > #[\Attribute] > class AttribWithNam

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Larry Garfield
On Tue, May 30, 2023, at 2:49 PM, Andreas Hennings wrote: > On Tue, 30 May 2023 at 15:14, Stephen Reay wrote: >> >> (Resending to the list without all the history because qmail complained >> about message size) >> >> >> >> >> >> Hi Andreas, >> >> >> >> I too have wondered (and I think asked in ro

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Andreas Hennings
On Tue, 30 May 2023 at 15:14, Stephen Reay wrote: > > (Resending to the list without all the history because qmail complained about > message size) > > > >> > >> Hi Andreas, > >> > >> I too have wondered (and I think asked in room11?) about such a concept. > >> >From memory the general response

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Stephen Reay
(Resending to the list without all the history because qmail complained about message size) >> >> Hi Andreas, >> >> I too have wondered (and I think asked in room11?) about such a concept. >> >From memory the general response was “just do it in userland with a >> wrapper” so its good to see

Re: [PHP-DEV] Declaration-aware attributes

2023-05-30 Thread Andreas Hennings
On Tue, 30 May 2023 at 05:22, Stephen Reay wrote: > > > > > On 30 May 2023, at 07:48, Andreas Hennings wrote: > > > > Hello internals, > > I am picking up an idea that was mentioned by Benjamin Eberlei in the past. > > https://externals.io/message/110217#110395 > > (we probably had the idea indep

Re: [PHP-DEV] Declaration-aware attributes

2023-05-29 Thread Stephen Reay
> On 30 May 2023, at 07:48, Andreas Hennings wrote: > > Hello internals, > I am picking up an idea that was mentioned by Benjamin Eberlei in the past. > https://externals.io/message/110217#110395 > (we probably had the idea independently, but Benjamin's is the first > post where I see it menti

Re: [PHP-DEV] Declaration-aware attributes

2023-05-29 Thread Andreas Hennings
Thanks for the feedback! On Tue, 30 May 2023 at 03:43, Dusk wrote: > > On May 29, 2023, at 17:48, Andreas Hennings wrote: > > Quite often I found myself writing attribute classes that need to fill > > some default values or do some validation based on the symbol the > > attribute is attached to.

Re: [PHP-DEV] Declaration-aware attributes

2023-05-29 Thread Dusk
On May 29, 2023, at 17:48, Andreas Hennings wrote: > Quite often I found myself writing attribute classes that need to fill > some default values or do some validation based on the symbol the > attribute is attached to. > E.g. a parameter attribute might require a specific type on that > parameter

[PHP-DEV] Declaration-aware attributes

2023-05-29 Thread Andreas Hennings
Hello internals, I am picking up an idea that was mentioned by Benjamin Eberlei in the past. https://externals.io/message/110217#110395 (we probably had the idea independently, but Benjamin's is the first post where I see it mentioned in the list) Quite often I found myself writing attribute class