|
$type = (string) $method->getReturnType(); |
https://www.php.net/manual/en/reflectiontype.tostring.php
You can get the name from the https://www.php.net/manual/en/class.reflectionnamedtype.php
But I don't have any idea how to retrieve that object from the ReflectionMethod? Do you guys knows how to solve this problem?