mirror of
https://github.com/danog/psalm.git
synced 2024-12-05 13:10:49 +01:00
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";
|
||
|
}
|
||
|
```
|