Closed Ocramius closed 3 years ago
Reporting it mostly for self-reference (want to open a PR when I have time to test it), but the return type of Enum#getValue() should be @psalm-return static::*, indicating that it is the value of any of the defined constants.
Enum#getValue()
@psalm-return static::*
I think this would include private, protected and public constants where only public constants are possible.
For PHPStan we have created an extension for this: https://github.com/marc-mabe/php-enum-phpstan
Reporting it mostly for self-reference (want to open a PR when I have time to test it), but the return type of
Enum#getValue()
should be@psalm-return static::*
, indicating that it is the value of any of the defined constants.