Re: [RFC] Attributes v2
| From: | Mike Schinkel | Date: | Tue, 10 Mar 2020 20:41:46 +0000 |
| Subject: | Re: [RFC] Attributes v2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108963@lists.php.net to get a copy of this message | ||
>
> On Mar 10, 2020 at 3:49 PM, <Benjamin Eberlei (mailto:kontakt@beberlei.de)> wrote:
>
>
>
>
>
> On Tue, Mar 10, 2020 at 5:30 PM Mike Schinkel <mike@newclarity.net
> (mailto:mike@newclarity.net)> wrote:
>
> > > On Mar 10, 2020, at 11:28 AM, Benjamin Eberlei <kontakt@beberlei.de
> > > (mailto:kontakt@beberlei.de)> wrote:
> > >
> > > Just to make sure you don't run in circles in this discussion thread here,
> > > even when syntax is not fixed yet, it's not going to be a syntax where the attributes are
> > > suffixed after the declaration. It would maybe some other characters like %[Attr].
> > >
> >
> > It is your RFC so you are the arbiter.
> >
> > One final on syntax: Can I suggest you consider @:Attr?
> >
> > -Mike
> > P. S. Did you see the question on interfaces?
> >
>
>
>
> No I missed it. Attributes work on interfaces, but they are not inherited to parent classes.
> This is similar to how a class implementing an interface may have different docblocks. You can use
> the reflection api to get to interfaces from a class and check for their attributes there. For
> traits the attributes get copied into the using class.
>
>
>
>
I think you may have misunderstood my question. I was asking if using an interface we could
*require* a class to implement specific attributes. If yes that would be extremely valuable.
-Mike