original_string: public function addHeaderOb(Horde_Mime_Headers_Element $ob, $check = false)
      {
          if ($check) {
              $cname = $this->_getHeaderClassName($ob->name);
              if (!($ob instanceof $cname)) {
                  throw new InvalidArgumentException(sprintf(
                      'Object is not correct class: %s',
                      $cname
                  ));
              }
          }
  
          /* Existing header? Add to that object. */
          if ($hdr = $this[$ob->name]) {
              $hdr->setValue($ob);
          } else {
              $this->_headers[$ob->name] = $ob;
          }
      }
code: public function addHeaderOb(Horde_Mime_Headers_Element $ob, $check = false)
      {
          if ($check) {
              $cname = $this->_getHeaderClassName($ob->name);
              if (!($ob instanceof $cname)) {
                  throw new InvalidArgumentException(sprintf(
                      'Object is not correct class: %s',
                      $cname
                  ));
              }
          }
  
          /* Existing header? Add to that object. */
          if ($hdr = $this[$ob->name]) {
              $hdr->setValue($ob);
          } else {
              $this->_headers[$ob->name] = $ob;
          }
      }
code_tokens: public function addHeaderOb ( Horde_Mime_Headers_Element $ ob , $ check = false ) { if ( $ check ) { $ cname = $ this -> _getHeaderClassName ( $ ob -> name ) ; if ( ! ( $ ob instanceof $ cname ) ) { throw new InvalidArgumentException ( sprintf ( 'Object is not correct class: %s' , $ cname ) ) ; } } /* Existing header? Add to that object. */ if ( $ hdr = $ this [ $ ob -> name ] ) { $ hdr -> setValue ( $ ob ) ; } else { $ this -> _headers [ $ ob -> name ] = $ ob ; } }
docstring: Add a Horde_Mime_Headers_Element object to the current header list.
  
  @since 2.5.0
  
  @param Horde_Mime_Headers_Element $ob  Header object to add.
  @param boolean $check                  Check that the header and object
  type match?
  
  @throws InvalidArgumentException
docstring_tokens: Add a Horde_Mime_Headers_Element object to the current header list .