mirror of
https://github.com/danog/psalm.git
synced 2024-12-05 13:10:49 +01:00
16 lines
274 B
Markdown
16 lines
274 B
Markdown
|
# InvalidEnumMethod
|
||
|
|
||
|
Enums may not define most of the magic methods like `__get`, `__toString`, etc.
|
||
|
|
||
|
```php
|
||
|
<?php
|
||
|
enum Status: string {
|
||
|
case Open = 'open';
|
||
|
case Closed = 'closed';
|
||
|
|
||
|
public function __toString(): string {
|
||
|
return "SomeStatus";
|
||
|
}
|
||
|
}
|
||
|
```
|