marc-mabe/php-enum-phpstan
PHPStan extension for marc-mabe/php-enum. Teaches PHPStan about enum accessor methods and allowed values so static analysis understands your enumerations and catches invalid usage. Install with Composer and include the provided extension.neon.
php-enum < 4.0Full Changelog: https://github.com/marc-mabe/php-enum-phpstan/compare/v2.0.1...v3.0.0
$enum::getValues() thanks to @pascalheidmann#9, #11, #12 Added support for PHPStan 1.0 and dropped support for earlier releases thanks @ondrejmirtes
#7, #8 Added support for PHP-8
#4 #5 fixed return type detection of [self|static]::getValues()
Detect possible return types of static call Enum::getValues()
Added dynamic return type detection for Enum->getValue() & Enum->getValues().
getValue()/getValues() of an enumeration by defined enumerators
IntEnum|StrEnum will be a union of int|stringSupport detection of Enum::CONST() accessor methods including:
How can I help you explore Laravel packages today?