EventListener/RegistrationSubscriber.php
public function getIpInfo()
    {
        $request = $this->requestStack->getCurrentRequest();

        $ipInfo = [];
        $ipInfo['country'] = $request->server->get('GEOIP_COUNTRY_CODE', null);
        $ipInfo['city'] = $request->server->get('GEOIP_CITY', null);
        $ipInfo['region'] = $request->server->get('GEOIP_REGION_NAME', null);
        $ipInfo['ip'] = $request->getClientIp();

        return $ipInfo;
    }
public function getIpInfo()
    {
        $request = $this->requestStack->getCurrentRequest();

        $ipInfo = [];
        $ipInfo['country'] = $request->server->get('GEOIP_COUNTRY_CODE', null);
        $ipInfo['city'] = $request->server->get('GEOIP_CITY', null);
        $ipInfo['region'] = $request->server->get('GEOIP_REGION_NAME', null);
        $ipInfo['ip'] = $request->getClientIp();

        return $ipInfo;
    }
public function getIpInfo ( ) { $ request = $ this -> requestStack -> getCurrentRequest ( ) ; $ ipInfo = [ ] ; $ ipInfo [ 'country' ] = $ request -> server -> get ( 'GEOIP_COUNTRY_CODE' , null ) ; $ ipInfo [ 'city' ] = $ request -> server -> get ( 'GEOIP_CITY' , null ) ; $ ipInfo [ 'region' ] = $ request -> server -> get ( 'GEOIP_REGION_NAME' , null ) ; $ ipInfo [ 'ip' ] = $ request -> getClientIp ( ) ; return $ ipInfo ; }
Gets array with IP info and Geo Ip

@return array
Gets array with IP info and Geo Ip