PHPStan\Reflection\Php\PhpMethodFromParserNodeReflection::getReturnType PHP Method

getReturnType() public method

public getReturnType ( ) : PHPStan\Type\Type
return PHPStan\Type\Type
    public function getReturnType() : Type
    {
        if ($this->returnType === null) {
            $phpDocReturnType = $this->phpDocReturnType;
            if ($this->realReturnTypePresent && $phpDocReturnType !== null && $this->realReturnType->isNullable() !== $phpDocReturnType->isNullable()) {
                $phpDocReturnType = null;
            }
            $this->returnType = TypehintHelper::decideType($this->realReturnType, $phpDocReturnType);
        }
        return $this->returnType;
    }