Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated class is not detected #116

Open
ghost opened this issue Jun 29, 2024 · 2 comments
Open

Deprecated class is not detected #116

ghost opened this issue Jun 29, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 29, 2024

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).

@ghost ghost changed the title Deprecated class is not detected Deprecated class from vendor/ is not detected Jun 29, 2024
@ondrejmirtes
Copy link
Member

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

Also share the declaration of the exception.

@ghost
Copy link
Author

ghost commented Jun 29, 2024

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

@ghost ghost changed the title Deprecated class from vendor/ is not detected Deprecated class from is not detected Jun 29, 2024
@ghost ghost changed the title Deprecated class from is not detected Deprecated class is not detected Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant