PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.

Installs: 14 825 637

Dependents: 2 003

Suggesters: 6

Security: 0

Stars: 242

Watchers: 5

Forks: 13

Open Issues: 12


1.0.0 2021-09-23 11:02 UTC

This package is auto-updated.

Last update: 2022-12-07 16:49:16 UTC


Build Latest Stable Version License


To use this extension, require it in Composer:

composer require --dev phpstan/phpstan-deprecation-rules

If you also install phpstan/extension-installer then you're all set!

Manual installation

If you don't want to use phpstan/extension-installer, include rules.neon in your project's PHPStan config:

    - vendor/phpstan/phpstan-deprecation-rules/rules.neon

Deprecating code you don't own

This extension emits deprecation warnings on code, which uses properties/functions/methods/classes which are annotated as @deprecated.

In case you don't own the code which you want to be considered deprecated, use PHPStan Stub Files to declare deprecations for vendor files like:

/** @deprecated */
class ThirdPartyClass {}