---
title: "analyse/classes/invalid-enum"
pagination: false
---

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

<RuleId id="analyse/classes/invalid-enum" />

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

## Configuration

```toml title="pun.toml"
[analyse.rules]
"classes/invalid-enum" = "on"
```

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

## Replaces

- [`EnumSanityRule`](https://phpstan.org/error-identifiers/enum.backingType) (phpstan-classes)
- [`DuplicateEnumCaseValue`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`InvalidEnumCaseValue`](https://mago.carthage.software/1.61.0/en/tools/analyzer/overview/) (mago-analyzer)
- [`enum.backingType`](https://phpstan.org/error-identifiers/enum.backingType) (phpstan)
- [`enum.caseType`](https://phpstan.org/error-identifiers/enum.caseType) (phpstan)
- [`enum.caseWithValue`](https://phpstan.org/error-identifiers/enum.caseWithValue) (phpstan)
- [`enum.constructor`](https://phpstan.org/error-identifiers/enum.constructor) (phpstan)
- [`enum.destructor`](https://phpstan.org/error-identifiers/enum.destructor) (phpstan)
- [`enum.duplicateValue`](https://phpstan.org/error-identifiers/enum.duplicateValue) (phpstan)
- [`enum.magicMethod`](https://phpstan.org/error-identifiers/enum.magicMethod) (phpstan)
- [`enum.methodRedeclaration`](https://phpstan.org/error-identifiers/enum.methodRedeclaration) (phpstan)
- [`enum.missingCase`](https://phpstan.org/error-identifiers/enum.missingCase) (phpstan)
- [`enum.serializable`](https://phpstan.org/error-identifiers/enum.serializable) (phpstan)

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