original_string: public function getProtocolVersion()
      {
          if ($this->isFromTrustedProxy()) {
              preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via'), $matches);
  
              if ($matches) {
                  return 'HTTP/'.$matches[2];
              }
          }
  
          return $this->server->get('SERVER_PROTOCOL');
      }
code: public function getProtocolVersion()
      {
          if ($this->isFromTrustedProxy()) {
              preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via'), $matches);
  
              if ($matches) {
                  return 'HTTP/'.$matches[2];
              }
          }
  
          return $this->server->get('SERVER_PROTOCOL');
      }
code_tokens: public function getProtocolVersion ( ) { if ( $ this -> isFromTrustedProxy ( ) ) { preg_match ( '~^(HTTP/)?([1-9]\.[0-9]) ~' , $ this -> headers -> get ( 'Via' ) , $ matches ) ; if ( $ matches ) { return 'HTTP/' . $ matches [ 2 ] ; } } return $ this -> server -> get ( 'SERVER_PROTOCOL' ) ; }
docstring: Returns the protocol version.
  
  If the application is behind a proxy, the protocol version used in the
  requests between the client and the proxy and between the proxy and the
  server might be different. This returns the former (from the "Via" header)
  if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns
  the latter (from the "SERVER_PROTOCOL" server parameter).
  
  @return string
docstring_tokens: Returns the protocol version .