ging-dev https://phpstan.org/blog/phpstan-1-6-0-with-conditional-return-types /** * @param bool $isAdmin * @return ($isAdmin is true ? Admin : User) */ function user($isAdmin) { } In my opinion the simplest approach is to reduce them to union type. For example user(): Admin|User.
JakubMisek ging-dev thank you, Right, we need to parse it and treat it as a union for now; adding it to our to-do.