/**
  * @return string IP where user is located
  */
 public function getIp()
 {
     if ($this->mockIp !== false) {
         return $this->mockIp;
     }
     $validator = new \DevGroup\Multilingual\validators\IpValidator();
     $validator->ipv4 = true;
     if ($this->useClientIp === true && isset($_SERVER['HTTP_CLIENT_IP'])) {
         if ($validator->validate($_SERVER['HTTP_CLIENT_IP'])) {
             return $_SERVER['HTTP_CLIENT_IP'];
         }
     }
     if ($this->useXForwardedFor === true && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         if ($validator->validate($_SERVER['HTTP_X_FORWARDED_FOR'])) {
             return $_SERVER['HTTP_X_FORWARDED_FOR'];
         }
     }
     return Yii::$app->request->userIP;
 }
 /**
  * @return string IP where user is located
  */
 private function getUserIp()
 {
     $validator = new \DevGroup\Multilingual\validators\IpValidator();
     $validator->ipv4 = true;
     if (isset($_SERVER['HTTP_CLIENT_IP'])) {
         if ($validator->validate($_SERVER['HTTP_CLIENT_IP'])) {
             return $_SERVER['HTTP_CLIENT_IP'];
         }
     }
     if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
         if ($validator->validate($_SERVER['HTTP_X_FORWARDED_FOR'])) {
             return $_SERVER['HTTP_X_FORWARDED_FOR'];
         }
     }
     return Yii::$app->request->userIP;
 }