concrete/src/Utility/IPAddress.php
public function getIp($format = self::FORMAT_HEX)
    {
        if ($this->ipHex === null) {
            return null;
        } elseif ($format === self::FORMAT_HEX) {
            return $this->ipHex;
        } elseif ($format === self::FORMAT_IP_STRING) {
            return inet_ntop($this->hex2bin($this->ipHex));
        }
        throw new \Exception('Invalid IP format');
    }
public function getIp($format = self::FORMAT_HEX)
    {
        if ($this->ipHex === null) {
            return null;
        } elseif ($format === self::FORMAT_HEX) {
            return $this->ipHex;
        } elseif ($format === self::FORMAT_IP_STRING) {
            return inet_ntop($this->hex2bin($this->ipHex));
        }
        throw new \Exception('Invalid IP format');
    }
public function getIp ( $ format = self :: FORMAT_HEX ) { if ( $ this -> ipHex === null ) { return null ; } elseif ( $ format === self :: FORMAT_HEX ) { return $ this -> ipHex ; } elseif ( $ format === self :: FORMAT_IP_STRING ) { return inet_ntop ( $ this -> hex2bin ( $ this -> ipHex ) ) ; } throw new \ Exception ( 'Invalid IP format' ) ; }
Returns the IPAddress string, null if no ip address has been set.

@param int $format Uses the IPAddress::FORMAT_* constants

@throws \Exception Throws an exception if the value is not null and no valid format constant is given

@return string|null
Returns the IPAddress string null if no ip address has been set .