original_string: public function write($format = 'rtf')
  	{
  		if ( ! is_string($format)) {
  			throw new \InvalidArgumentException(
  				__METHOD__."() expects parameter one, format, to be a string"
  			);
  		}
  		
  		// get the snippet (which is posing as a group) as a string
  		$string = (new Writer())->write($this, $format);
  		
  		// if the format is "rtf", remove the group-open and group-close we added
  		if ($format === 'rtf') {
  			$string = substr($string, 1, -1);	
  		}
  		
  		return $string;
  	}
code: public function write($format = 'rtf')
  	{
  		if ( ! is_string($format)) {
  			throw new \InvalidArgumentException(
  				__METHOD__."() expects parameter one, format, to be a string"
  			);
  		}
  		
  		// get the snippet (which is posing as a group) as a string
  		$string = (new Writer())->write($this, $format);
  		
  		// if the format is "rtf", remove the group-open and group-close we added
  		if ($format === 'rtf') {
  			$string = substr($string, 1, -1);	
  		}
  		
  		return $string;
  	}
code_tokens: public function write ( $ format = 'rtf' ) { if ( ! is_string ( $ format ) ) { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one, format, to be a string" ) ; } // get the snippet (which is posing as a group) as a string $ string = ( new Writer ( ) ) -> write ( $ this , $ format ) ; // if the format is "rtf", remove the group-open and group-close we added if ( $ format === 'rtf' ) { $ string = substr ( $ string , 1 , - 1 ) ; } return $ string ; }
docstring: Writes the snippet to a string
  
  @param  string  $format  the desired format (possible values are "rtf",
  "text", and "html") (optional; if omitted, defaults to "rtf")
  @return  string
  @throws  InvalidArgumentException  if $format is not a string
  @since  0.4.0
docstring_tokens: Writes the snippet to a string