original_string: public function createConnection(array $config)
      {
          if (! isset($config['host'])) {
              throw new InvalidArgumentException("No host provided.");
          }
  
          $this->setHost($config['host']);
  
          // We check the configuration for request headers. Some API's require
          // certain headers for all requests. Providing them in the configuration
          // makes it easier to provide these headers on each request.
          if (isset($config['headers'])) {
              $this->setHeaders($config['headers']);
          }
  
          return $this;
      }
code: public function createConnection(array $config)
      {
          if (! isset($config['host'])) {
              throw new InvalidArgumentException("No host provided.");
          }
  
          $this->setHost($config['host']);
  
          // We check the configuration for request headers. Some API's require
          // certain headers for all requests. Providing them in the configuration
          // makes it easier to provide these headers on each request.
          if (isset($config['headers'])) {
              $this->setHeaders($config['headers']);
          }
  
          return $this;
      }
code_tokens: public function createConnection ( array $ config ) { if ( ! isset ( $ config [ 'host' ] ) ) { throw new InvalidArgumentException ( "No host provided." ) ; } $ this -> setHost ( $ config [ 'host' ] ) ; // We check the configuration for request headers. Some API's require // certain headers for all requests. Providing them in the configuration // makes it easier to provide these headers on each request. if ( isset ( $ config [ 'headers' ] ) ) { $ this -> setHeaders ( $ config [ 'headers' ] ) ; } return $ this ; }
docstring: Initialize connector.
  
  @param  array  $config
  @return self
  @throws InvalidArgumentException
docstring_tokens: Initialize connector .