original_string: public function getEndpointAsUrl($port, $protocol = 'tcp')
      {
          if (!$this->hasEndpoint($port, $protocol)) {
              throw new Exception('Endpoint is not available');
          }
  
          $key = $port . '/' . $protocol;
  
          return Url::fromString($this->endpoints[$key]);
      }
code: public function getEndpointAsUrl($port, $protocol = 'tcp')
      {
          if (!$this->hasEndpoint($port, $protocol)) {
              throw new Exception('Endpoint is not available');
          }
  
          $key = $port . '/' . $protocol;
  
          return Url::fromString($this->endpoints[$key]);
      }
code_tokens: public function getEndpointAsUrl ( $ port , $ protocol = 'tcp' ) { if ( ! $ this -> hasEndpoint ( $ port , $ protocol ) ) { throw new Exception ( 'Endpoint is not available' ) ; } $ key = $ port . '/' . $ protocol ; return Url :: fromString ( $ this -> endpoints [ $ key ] ) ; }
docstring: Try to get a single endpoint as a Url
  
  @param $port
  @param string $protocol
  
  @return Url
  @throws Exception
docstring_tokens: Try to get a single endpoint as a Url