---
title: "analyse/deprecated/class"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="analyse/deprecated/class" />

In the [`analyse-recommended`](/docs/rules/presets/analyse-recommended) preset and every stricter one. Report only.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"deprecated/class" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`RestrictedDeprecatedClassNameUsageExtension`](https://github.com/phpstan/phpstan-deprecation-rules#readme) (phpstan-classes)
- [`DeprecatedClass`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`catch.deprecatedClass`](https://phpstan.org/error-identifiers/catch.deprecatedClass) (phpstan-deprecation-rules)
- [`catch.deprecatedEnum`](https://phpstan.org/error-identifiers/catch.deprecatedEnum) (phpstan-deprecation-rules)
- [`catch.deprecatedInterface`](https://phpstan.org/error-identifiers/catch.deprecatedInterface) (phpstan-deprecation-rules)
- [`catch.deprecatedTrait`](https://phpstan.org/error-identifiers/catch.deprecatedTrait) (phpstan-deprecation-rules)
- [`class.deprecated`](https://phpstan.org/error-identifiers/class.deprecated) (phpstan-deprecation-rules)
- [`class.extendsDeprecatedClass`](https://phpstan.org/error-identifiers/class.extendsDeprecatedClass) (phpstan-deprecation-rules)
- [`class.extendsDeprecatedEnum`](https://phpstan.org/error-identifiers/class.extendsDeprecatedEnum) (phpstan-deprecation-rules)
- [`class.extendsDeprecatedInterface`](https://phpstan.org/error-identifiers/class.extendsDeprecatedInterface) (phpstan-deprecation-rules)
- [`class.extendsDeprecatedTrait`](https://phpstan.org/error-identifiers/class.extendsDeprecatedTrait) (phpstan-deprecation-rules)
- [`class.implementsDeprecatedClass`](https://phpstan.org/error-identifiers/class.implementsDeprecatedClass) (phpstan-deprecation-rules)
- [`class.implementsDeprecatedEnum`](https://phpstan.org/error-identifiers/class.implementsDeprecatedEnum) (phpstan-deprecation-rules)
- [`class.implementsDeprecatedInterface`](https://phpstan.org/error-identifiers/class.implementsDeprecatedInterface) (phpstan-deprecation-rules)
- [`class.implementsDeprecatedTrait`](https://phpstan.org/error-identifiers/class.implementsDeprecatedTrait) (phpstan-deprecation-rules)
- [`enum.implementsDeprecatedClass`](https://phpstan.org/error-identifiers/enum.implementsDeprecatedClass) (phpstan-deprecation-rules)
- [`enum.implementsDeprecatedEnum`](https://phpstan.org/error-identifiers/enum.implementsDeprecatedEnum) (phpstan-deprecation-rules)
- [`enum.implementsDeprecatedInterface`](https://phpstan.org/error-identifiers/enum.implementsDeprecatedInterface) (phpstan-deprecation-rules)
- [`enum.implementsDeprecatedTrait`](https://phpstan.org/error-identifiers/enum.implementsDeprecatedTrait) (phpstan-deprecation-rules)
- [`instanceof.deprecatedClass`](https://phpstan.org/error-identifiers/instanceof.deprecatedClass) (phpstan-deprecation-rules)
- [`instanceof.deprecatedEnum`](https://phpstan.org/error-identifiers/instanceof.deprecatedEnum) (phpstan-deprecation-rules)
- [`instanceof.deprecatedInterface`](https://phpstan.org/error-identifiers/instanceof.deprecatedInterface) (phpstan-deprecation-rules)
- [`instanceof.deprecatedTrait`](https://phpstan.org/error-identifiers/instanceof.deprecatedTrait) (phpstan-deprecation-rules)
- [`interface.extendsDeprecatedClass`](https://phpstan.org/error-identifiers/interface.extendsDeprecatedClass) (phpstan-deprecation-rules)
- [`interface.extendsDeprecatedEnum`](https://phpstan.org/error-identifiers/interface.extendsDeprecatedEnum) (phpstan-deprecation-rules)
- [`interface.extendsDeprecatedInterface`](https://phpstan.org/error-identifiers/interface.extendsDeprecatedInterface) (phpstan-deprecation-rules)
- [`interface.extendsDeprecatedTrait`](https://phpstan.org/error-identifiers/interface.extendsDeprecatedTrait) (phpstan-deprecation-rules)
- [`parameter.deprecatedClass`](https://phpstan.org/error-identifiers/parameter.deprecatedClass) (phpstan-deprecation-rules)
- [`parameter.deprecatedEnum`](https://phpstan.org/error-identifiers/parameter.deprecatedEnum) (phpstan-deprecation-rules)
- [`parameter.deprecatedInterface`](https://phpstan.org/error-identifiers/parameter.deprecatedInterface) (phpstan-deprecation-rules)
- [`parameter.deprecatedTrait`](https://phpstan.org/error-identifiers/parameter.deprecatedTrait) (phpstan-deprecation-rules)
- [`return.deprecatedClass`](https://phpstan.org/error-identifiers/return.deprecatedClass) (phpstan-deprecation-rules)
- [`return.deprecatedEnum`](https://phpstan.org/error-identifiers/return.deprecatedEnum) (phpstan-deprecation-rules)
- [`return.deprecatedInterface`](https://phpstan.org/error-identifiers/return.deprecatedInterface) (phpstan-deprecation-rules)
- [`return.deprecatedTrait`](https://phpstan.org/error-identifiers/return.deprecatedTrait) (phpstan-deprecation-rules)
- [`traitUse.deprecatedClass`](https://phpstan.org/error-identifiers/traitUse.deprecatedClass) (phpstan-deprecation-rules)
- [`traitUse.deprecatedEnum`](https://phpstan.org/error-identifiers/traitUse.deprecatedEnum) (phpstan-deprecation-rules)
- [`traitUse.deprecatedInterface`](https://phpstan.org/error-identifiers/traitUse.deprecatedInterface) (phpstan-deprecation-rules)
- [`traitUse.deprecatedTrait`](https://phpstan.org/error-identifiers/traitUse.deprecatedTrait) (phpstan-deprecation-rules)

[More analyse/deprecated rules](/docs/rules/analyse/deprecated) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
