original_string: public function write(MessageCatalogue $catalogue, $format, $options = [])
      {
          if (!isset($this->dumpers[$format])) {
              throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format));
          }
  
          // get the right dumper
          $dumper = $this->dumpers[$format];
  
          if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) {
              throw new RuntimeException(sprintf('Translation Writer was not able to create directory "%s"', $options['path']));
          }
  
          // save
          $dumper->dump($catalogue, $options);
      }
code: public function write(MessageCatalogue $catalogue, $format, $options = [])
      {
          if (!isset($this->dumpers[$format])) {
              throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format));
          }
  
          // get the right dumper
          $dumper = $this->dumpers[$format];
  
          if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) {
              throw new RuntimeException(sprintf('Translation Writer was not able to create directory "%s"', $options['path']));
          }
  
          // save
          $dumper->dump($catalogue, $options);
      }
code_tokens: public function write ( MessageCatalogue $ catalogue , $ format , $ options = [ ] ) { if ( ! isset ( $ this -> dumpers [ $ format ] ) ) { throw new InvalidArgumentException ( sprintf ( 'There is no dumper associated with format "%s".' , $ format ) ) ; } // get the right dumper $ dumper = $ this -> dumpers [ $ format ] ; if ( isset ( $ options [ 'path' ] ) && ! is_dir ( $ options [ 'path' ] ) && ! @ mkdir ( $ options [ 'path' ] , 0777 , true ) && ! is_dir ( $ options [ 'path' ] ) ) { throw new RuntimeException ( sprintf ( 'Translation Writer was not able to create directory "%s"' , $ options [ 'path' ] ) ) ; } // save $ dumper -> dump ( $ catalogue , $ options ) ; }
docstring: Writes translation from the catalogue according to the selected format.
  
  @param MessageCatalogue $catalogue The message catalogue to write
  @param string           $format    The format to use to dump the messages
  @param array            $options   Options that are passed to the dumper
  
  @throws InvalidArgumentException
docstring_tokens: Writes translation from the catalogue according to the selected format .