original_string: public function setSocket()
      {
          if (empty($this->uri['scheme'])) {
              throw new OutOfBoundsException('Unknown URL scheme');
          }
  
          if ($this->uri['scheme'] === 'http') {
              $port = 80;
              $protocol = 'tcp';
          } else if ($this->uri['scheme'] === 'https') {
              $port = 443;
              $protocol = 'ssl';
          } else {
              throw new UnexpectedValueException("Unsupported URL scheme: {$this->uri['scheme']}");
          }
  
          if (isset($this->uri['port'])) {
              $port = $this->uri['port'];
          }
  
          $this->socket = "$protocol://{$this->uri['host']}:$port";
  
          if (!isset($this->headers['Host'])) {
              $this->headers['Host'] = "{$this->uri['host']}:$port";
          }
  
          return $this;
      }
code: public function setSocket()
      {
          if (empty($this->uri['scheme'])) {
              throw new OutOfBoundsException('Unknown URL scheme');
          }
  
          if ($this->uri['scheme'] === 'http') {
              $port = 80;
              $protocol = 'tcp';
          } else if ($this->uri['scheme'] === 'https') {
              $port = 443;
              $protocol = 'ssl';
          } else {
              throw new UnexpectedValueException("Unsupported URL scheme: {$this->uri['scheme']}");
          }
  
          if (isset($this->uri['port'])) {
              $port = $this->uri['port'];
          }
  
          $this->socket = "$protocol://{$this->uri['host']}:$port";
  
          if (!isset($this->headers['Host'])) {
              $this->headers['Host'] = "{$this->uri['host']}:$port";
          }
  
          return $this;
      }
code_tokens: public function setSocket ( ) { if ( empty ( $ this -> uri [ 'scheme' ] ) ) { throw new OutOfBoundsException ( 'Unknown URL scheme' ) ; } if ( $ this -> uri [ 'scheme' ] === 'http' ) { $ port = 80 ; $ protocol = 'tcp' ; } else if ( $ this -> uri [ 'scheme' ] === 'https' ) { $ port = 443 ; $ protocol = 'ssl' ; } else { throw new UnexpectedValueException ( "Unsupported URL scheme: {$this->uri['scheme']}" ) ; } if ( isset ( $ this -> uri [ 'port' ] ) ) { $ port = $ this -> uri [ 'port' ] ; } $ this -> socket = "$protocol://{$this->uri['host']}:$port" ; if ( ! isset ( $ this -> headers [ 'Host' ] ) ) { $ this -> headers [ 'Host' ] = "{$this->uri['host']}:$port" ; } return $ this ; }
docstring: Sets a socket depending on the current URI parameters
  @return $this
  @throws OutOfBoundsException
  @throws UnexpectedValueException
docstring_tokens: Sets a socket depending on the current URI parameters