private function determineRemoteIpAddress(array $server): string
    {
        if (array_key_exists('HTTP_X_FORWARDED_FOR', $server) && filter_var($server['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) {
            return $server['HTTP_X_FORWARDED_FOR'];
        } elseif (array_key_exists('HTTP_CLIENT_IP', $server) && filter_var($server['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP)) {
            return $server['HTTP_CLIENT_IP'];
        } elseif (array_key_exists('HTTP_TRUE_CLIENT_IP', $server) && filter_var($server['HTTP_TRUE_CLIENT_IP'], FILTER_VALIDATE_IP)) {
            return $server['HTTP_TRUE_CLIENT_IP'];
        }

        return $server['REMOTE_ADDR'];
    }
private function determineRemoteIpAddress(array $server): string
    {
        if (array_key_exists('HTTP_X_FORWARDED_FOR', $server) && filter_var($server['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP)) {
            return $server['HTTP_X_FORWARDED_FOR'];
        } elseif (array_key_exists('HTTP_CLIENT_IP', $server) && filter_var($server['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP)) {
            return $server['HTTP_CLIENT_IP'];
        } elseif (array_key_exists('HTTP_TRUE_CLIENT_IP', $server) && filter_var($server['HTTP_TRUE_CLIENT_IP'], FILTER_VALIDATE_IP)) {
            return $server['HTTP_TRUE_CLIENT_IP'];
        }

        return $server['REMOTE_ADDR'];
    }
private function determineRemoteIpAddress ( array $ server ) : string { if ( array_key_exists ( 'HTTP_X_FORWARDED_FOR' , $ server ) && filter_var ( $ server [ 'HTTP_X_FORWARDED_FOR' ] , FILTER_VALIDATE_IP ) ) { return $ server [ 'HTTP_X_FORWARDED_FOR' ] ; } elseif ( array_key_exists ( 'HTTP_CLIENT_IP' , $ server ) && filter_var ( $ server [ 'HTTP_CLIENT_IP' ] , FILTER_VALIDATE_IP ) ) { return $ server [ 'HTTP_CLIENT_IP' ] ; } elseif ( array_key_exists ( 'HTTP_TRUE_CLIENT_IP' , $ server ) && filter_var ( $ server [ 'HTTP_TRUE_CLIENT_IP' ] , FILTER_VALIDATE_IP ) ) { return $ server [ 'HTTP_TRUE_CLIENT_IP' ] ; } return $ server [ 'REMOTE_ADDR' ] ; }
Determines the remote ip address by using passed server configuration.

@param string[] $server
The server configuration.
@return string The determined remote ip address.
Determines the remote ip address by using passed server configuration .