Mpociot\VatCalculator\VatCalculator::getClientIP PHP Method

getClientIP() private method

Finds the client IP address.
private getClientIP ( ) : mixed
return mixed
    private function getClientIP()
    {
        if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) {
            $clientIpAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } elseif (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR']) {
            $clientIpAddress = $_SERVER['REMOTE_ADDR'];
        } else {
            $clientIpAddress = '';
        }
        return $clientIpAddress;
    }