1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 18:48:03 +01:00
psalm/docs/running_psalm/issues/InvalidEnumMethod.md
Bruce Weirdan 19a1005bc3
Forbid most magic methods on enums
Fixes vimeo/psalm#8889

Additionally this fixes case-sensitivity of
MethodSignatureMustOmitReturnType issue

Fixes vimeo/psalm#8888
2022-12-12 03:03:20 -04:00

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";
}
}
```