Prose\FromHost::getHostname PHP Method

getHostname() public method

the returned hostname is suitable for use in HTTP/HTTPS URLs if we have been unable to determine the hostname for the host, this will return the host's IP address instead
public getHostname ( ) : string
return string
    public function getHostname()
    {
        // what are we doing?
        $log = usingLog()->startAction("get the hostname of host ID '{$this->args[0]}'");
        // make sure we have valid host details
        $hostDetails = $this->getHostDetails();
        // do we have a hostname?
        if (!isset($hostDetails->hostname)) {
            throw new E5xx_ActionFailed(__METHOD__, "no hostname found for host ID '{$this->args[0]}'");
        }
        // all done
        $log->endAction("hostname is '{$hostDetails->hostname}'");
        return $hostDetails->hostname;
    }