public function getReturnType()
{
if (version_compare(PHP_VERSION, '7.0.0-dev') >= 0 && $this->method->hasReturnType()) {
$returnType = (string) $this->method->getReturnType();
if ('self' === $returnType) {
$returnType = "\\" . $this->method->getDeclaringClass()->getName();
}
if (version_compare(PHP_VERSION, '7.1.0-dev') >= 0 && $this->method->getReturnType()->allowsNull()) {
$returnType = '?' . $returnType;
}
return $returnType;
}
return '';
}