phpstan/phpstan-deprecation-rules

Add detection of deprecated Attributes usage

Nemrtvej opened this issue · 2 comments

Hello,

would it be possible to also report a case where code uses an Attribute which is marked with @deprecated?

e.g. Given I have a following code:

<?php
/**
 * @deprecated 
 */
#[\Attribute]
final class DoSomethingTheOldWay
{
}


final class SomeDTO 
{
    #[\DoSomethingTheOldWay]
    public readonly string $property;
}

When I run this plugin.
Then the output will warn me that SomeDTO::$property is using a deprecated Attribute.

Did it in PHPStan core (while phpstan-deprecation-rules must be also installed) because it was easiest and took me just a few minutes: phpstan/phpstan-src@e46b0b4

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.