Feature request
Similar to phpstan/phpstan-src#2764, but useful if narrowed to the same type in PHPDoc too.
/**
* @param enum-string $s
*/
function f(string $s): void {
assertType('class-string<UnitEnum>', $s);
$cases = $s::cases();
assertType('list<UnitEnum>', $cases);
}
/**
* @param enum-string<UnitEnum> $s
*/
function g(string $s): void {
assertType('class-string<UnitEnum>', $s);
$cases = $s::cases();
assertType('list<UnitEnum>', $cases);
}
Did PHPStan help you today? Did it make you happy in any way?
I had been in poor physical condition since the end of last year, but I've started writing a beginner's tutorial to get back into the swing of things. While writing the description for the type, I realized that the enum-string could be improved.
Feature request
Similar to phpstan/phpstan-src#2764, but useful if narrowed to the same type in PHPDoc too.
Did PHPStan help you today? Did it make you happy in any way?
I had been in poor physical condition since the end of last year, but I've started writing a beginner's tutorial to get back into the swing of things. While writing the description for the type, I realized that the
enum-stringcould be improved.