Bug report
during atk4/data#932 development I found out when type is unioned type, DynamicMethodReturnTypeExtension::getTypeFromMethodCall is not executed
Code snippet that reproduces the problem
checkout atk4/data@fb9e504 and run phpstan
the union type come from https://github.com/atk4/data/blob/fb9e5046443e0a18289067b62fb7a4fb75aff957/tests/ModelPhpstanTest.php#L44 test
when I change it from random_int(0, 1) === 0 ? Female::class : Male::class to Male::class, the DynamicMethodReturnTypeExtension::getTypeFromMethodCall is correctly called
Expected output
DynamicMethodReturnTypeExtension::getTypeFromMethodCall must be executed even when a method is called with an unioned type