1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 00:39:38 +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

274 B

InvalidEnumMethod

Enums may not define most of the magic methods like __get, __toString, etc.

<?php
enum Status: string {
    case Open = 'open';
    case Closed = 'closed';

    public function __toString(): string {
        return "SomeStatus";
    }
}