phpstan/phpstan-deprecation-rules

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

Installs: 2 552 823

Dependents: 502

Suggesters: 4

Security: 0

Stars: 144

Watchers: 8

Forks: 7

Open Issues: 1

Type:phpstan-extension

0.12.5 2020-07-21 14:52 UTC

This package is auto-updated.

Last update: 2020-10-22 10:03:46 UTC


README

Build Status Latest Stable Version License

Installation

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:

includes:
    - 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 {}