original_string: public function addTitle($text, $depth = 1) {
  		$styles = PHPWord_Style::getStyles();
  		if(array_key_exists('Heading_'.$depth, $styles)) {
  			$style = 'Heading'.$depth;
  		} else {
  			$style = null;
  		}
  		
  		$title = new PHPWord_Section_Title($text, $depth, $style);
  		
  		$data = PHPWord_TOC::addTitle($text, $depth);
  		$anchor = $data[0];
  		$bookmarkId = $data[1];
  		
  		$title->setAnchor($anchor);
  		$title->setBookmarkId($bookmarkId);
  		
  		$this->_elementCollection[] = $title;
  		return $title;
  	}
code: public function addTitle($text, $depth = 1) {
  		$styles = PHPWord_Style::getStyles();
  		if(array_key_exists('Heading_'.$depth, $styles)) {
  			$style = 'Heading'.$depth;
  		} else {
  			$style = null;
  		}
  		
  		$title = new PHPWord_Section_Title($text, $depth, $style);
  		
  		$data = PHPWord_TOC::addTitle($text, $depth);
  		$anchor = $data[0];
  		$bookmarkId = $data[1];
  		
  		$title->setAnchor($anchor);
  		$title->setBookmarkId($bookmarkId);
  		
  		$this->_elementCollection[] = $title;
  		return $title;
  	}
code_tokens: public function addTitle ( $ text , $ depth = 1 ) { $ styles = PHPWord_Style :: getStyles ( ) ; if ( array_key_exists ( 'Heading_' . $ depth , $ styles ) ) { $ style = 'Heading' . $ depth ; } else { $ style = null ; } $ title = new PHPWord_Section_Title ( $ text , $ depth , $ style ) ; $ data = PHPWord_TOC :: addTitle ( $ text , $ depth ) ; $ anchor = $ data [ 0 ] ; $ bookmarkId = $ data [ 1 ] ; $ title -> setAnchor ( $ anchor ) ; $ title -> setBookmarkId ( $ bookmarkId ) ; $ this -> _elementCollection [ ] = $ title ; return $ title ; }
docstring: Add a Title Element
  
  @param string $text
  @param int $depth
  @return PHPWord_Section_Title
docstring_tokens: Add a Title Element