mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
b4f024b1fe
* Duplicate cases * Duplicate case values * Invalid case values: value on a pure enum case, missing value on a backed enum case, backing type / case type mismatch * Literal expression evaluation for case values Fixes vimeo/psalm#6426 Fixes vimeo/psalm#6427
28 lines
338 B
Markdown
28 lines
338 B
Markdown
# DuplicateEnumCaseValue
|
|
|
|
Emitted when a backed enum has duplicate case values.
|
|
|
|
```php
|
|
<?php
|
|
|
|
enum Status: string
|
|
{
|
|
case Open = "open";
|
|
case Closed = "open";
|
|
}
|
|
```
|
|
|
|
## How to fix
|
|
|
|
Change case values so that there are no duplicates.
|
|
|
|
```php
|
|
<?php
|
|
|
|
enum Status: string
|
|
{
|
|
case Open = "open";
|
|
case Closed = "closed";
|
|
}
|
|
```
|