Hi,
in general there should be create dynamic return type extension. It will allow us to exactly know returned value from function call, or at least returned type.
Take example from
https://github.com/adaamz/phpstan-mabe-enum/blob/045e4ad/src/DynamicReturnTypeExtension.php
I'm not sure if it is up-to-date with latest phpstan, must check :)