Re: Re: [RFC] Constructor Property Promotion
| From: | Benjamin Eberlei | Date: | Wed, 29 Apr 2020 08:56:42 +0000 |
| Subject: | Re: Re: [RFC] Constructor Property Promotion | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109907@lists.php.net to get a copy of this message | ||
On Wed, Apr 29, 2020 at 9:47 AM Nicolas Grekas <nicolas.grekas+php@gmail.com>
wrote:
> > I think it might be best to apply to "both" and provide an isPromoted()
> > method on both ReflectionParameter and ReflectionProperty. Any code that
> > wishes to validate the allowed positions of an attribute can then skip
> > properties/parameters that report isPromoted() as true, to avoid
> reporting
> > false positives.
> >
>
> That sounds good. Deal on my side.
>
Just to mention, any approach here potentially conflicts with anything we
consider for potential target validation on attributes, i.e. declaring for
an attribute that it is only allowed on a property OR an argument.
At the point constructor promotion happens, we can also not look into the
attribute to see if its target=property or target=parameter, because this
would require triggering autoloader.
> Nicolas
>