original_string: protected function addOptionalHeaders($options)
      {
          if (!empty($options['headers'])) {
              foreach ((array) $options['headers'] as $header) {
                  list($name, $value) = array_pad((array) $header, 2, null);
                  $this->addHeader($name, $value);
              }
          }
  
          return $this;
      }
code: protected function addOptionalHeaders($options)
      {
          if (!empty($options['headers'])) {
              foreach ((array) $options['headers'] as $header) {
                  list($name, $value) = array_pad((array) $header, 2, null);
                  $this->addHeader($name, $value);
              }
          }
  
          return $this;
      }
code_tokens: protected function addOptionalHeaders ( $ options ) { if ( ! empty ( $ options [ 'headers' ] ) ) { foreach ( ( array ) $ options [ 'headers' ] as $ header ) { list ( $ name , $ value ) = array_pad ( ( array ) $ header , 2 , null ) ; $ this -> addHeader ( $ name , $ value ) ; } } return $ this ; }
docstring: Adds headers from options
  @param array $options
  @return $this
docstring_tokens: Adds headers from options