original_string: public function clientIp()
      {
          if ($this->trustProxy && $this->getEnv('HTTP_X_FORWARDED_FOR')) {
              $addresses = array_map('trim', explode(',', $this->getEnv('HTTP_X_FORWARDED_FOR')));
              $trusted = (count($this->trustedProxies) > 0);
              $n = count($addresses);
  
              if ($trusted) {
                  $trusted = array_diff($addresses, $this->trustedProxies);
                  $trusted = (count($trusted) === 1);
              }
  
              if ($trusted) {
                  return $addresses[0];
              }
  
              return $addresses[$n - 1];
          }
  
          if ($this->trustProxy && $this->getEnv('HTTP_X_REAL_IP')) {
              $ipaddr = $this->getEnv('HTTP_X_REAL_IP');
          } elseif ($this->trustProxy && $this->getEnv('HTTP_CLIENT_IP')) {
              $ipaddr = $this->getEnv('HTTP_CLIENT_IP');
          } else {
              $ipaddr = $this->getEnv('REMOTE_ADDR');
          }
  
          return trim($ipaddr);
      }
code: public function clientIp()
      {
          if ($this->trustProxy && $this->getEnv('HTTP_X_FORWARDED_FOR')) {
              $addresses = array_map('trim', explode(',', $this->getEnv('HTTP_X_FORWARDED_FOR')));
              $trusted = (count($this->trustedProxies) > 0);
              $n = count($addresses);
  
              if ($trusted) {
                  $trusted = array_diff($addresses, $this->trustedProxies);
                  $trusted = (count($trusted) === 1);
              }
  
              if ($trusted) {
                  return $addresses[0];
              }
  
              return $addresses[$n - 1];
          }
  
          if ($this->trustProxy && $this->getEnv('HTTP_X_REAL_IP')) {
              $ipaddr = $this->getEnv('HTTP_X_REAL_IP');
          } elseif ($this->trustProxy && $this->getEnv('HTTP_CLIENT_IP')) {
              $ipaddr = $this->getEnv('HTTP_CLIENT_IP');
          } else {
              $ipaddr = $this->getEnv('REMOTE_ADDR');
          }
  
          return trim($ipaddr);
      }
code_tokens: public function clientIp ( ) { if ( $ this -> trustProxy && $ this -> getEnv ( 'HTTP_X_FORWARDED_FOR' ) ) { $ addresses = array_map ( 'trim' , explode ( ',' , $ this -> getEnv ( 'HTTP_X_FORWARDED_FOR' ) ) ) ; $ trusted = ( count ( $ this -> trustedProxies ) > 0 ) ; $ n = count ( $ addresses ) ; if ( $ trusted ) { $ trusted = array_diff ( $ addresses , $ this -> trustedProxies ) ; $ trusted = ( count ( $ trusted ) === 1 ) ; } if ( $ trusted ) { return $ addresses [ 0 ] ; } return $ addresses [ $ n - 1 ] ; } if ( $ this -> trustProxy && $ this -> getEnv ( 'HTTP_X_REAL_IP' ) ) { $ ipaddr = $ this -> getEnv ( 'HTTP_X_REAL_IP' ) ; } elseif ( $ this -> trustProxy && $ this -> getEnv ( 'HTTP_CLIENT_IP' ) ) { $ ipaddr = $ this -> getEnv ( 'HTTP_CLIENT_IP' ) ; } else { $ ipaddr = $ this -> getEnv ( 'REMOTE_ADDR' ) ; } return trim ( $ ipaddr ) ; }
docstring: Get the IP the client is using, or says they are using.
  
  @return string The client IP.
docstring_tokens: Get the IP the client is using or says they are using .