phpstan/phpstan-deprecation-rules

Deprecated class is not detected

javaDeveloperKid opened this issue · 2 comments

v1.2

I use deprecated class Doctrine\ORM\ORMException.

use Doctrine\ORM\ORMException; // detected deprecation by PHPStorm IDE

class MyClass 
{
  /**
   * @throws ORMException
   */ 
  function f() {}
}
/**
 * Base exception class for all ORM exceptions.
 *
 * @deprecated Use Doctrine\ORM\Exception\ORMException for catch and instanceof
 */
class ORMException extends Exception

However phpstan/phpstan-deprecated-rules does not report this.
image

Double checked phpstan baseline if no one else has hidden this error.

It looks like this packages finds only method calls and not other statements (like use, catch for example).

How are you using it in code? Please share code as text and not as screenshot.

Also share the declaration of the exception.

Updated issue description. I use it in @throws doc block or try..catch block.