Re: #[Deprecated] Attribute
| From: | Sara Golemon | Date: | Tue, 22 Dec 2020 18:54:53 +0000 |
| Subject: | Re: #[Deprecated] Attribute | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112602@lists.php.net to get a copy of this message | ||
On Tue, Dec 22, 2020 at 12:35 PM Nicolas Grekas <
nicolas.grekas+php@gmail.com> wrote:
> It would be great to allow adding this attribute on classes. What about
> allowing it right now and not bind it to any runtime side-effect? That
> would allow static analyzers to do their job. Same for consts and
> properties by the way.
>
> Also, it would be very useful to add named parameters to the attribute,
> namely: "package" (the name of the package that declares the deprecation)
> and "version" (the version of that package that introduced the
> deprecation), next to the message.
>
> This is critical info when building reports of deprecations.
>
>
You could do that now with a polyfill from userspace. If the annotation
need not have an effect, then it's just any other userspace implementation.
-Sara