Bug report
The formal return value of ReflectionEnum::getBackingType() is ?ReflectionNamedType. But it will always return ReflectionNamedType (i.e.: be non-null) for backed enums. So when a ReflectionEnum::isBacked condition is applied the type could/should be narrowed.
Code snippet that reproduces the problem
https://phpstan.org/r/6708f7db-5547-47c6-aa37-38dc5974a1a4
Expected output
Type could/should be just ReflectionNamedType (but is ReflectionNamedType|null).
Did PHPStan help you today? Did it make you happy in any way?
No response