Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / translation / Writer / TranslationWriter.php
index 901a8894e1c4cf7dfbf2b0a8c1f498b32d53da97..5ff5cd855dfa4ac42a51b99e4f0f7ef9a7b808fd 100644 (file)
@@ -21,13 +21,8 @@ use Symfony\Component\Translation\Exception\RuntimeException;
  *
  * @author Michel Salib <michelsalib@hotmail.com>
  */
-class TranslationWriter
+class TranslationWriter implements TranslationWriterInterface
 {
-    /**
-     * Dumpers used for export.
-     *
-     * @var array
-     */
     private $dumpers = array();
 
     /**
@@ -66,13 +61,13 @@ class TranslationWriter
     /**
      * Writes translation from the catalogue according to the selected format.
      *
-     * @param MessageCatalogue $catalogue The message catalogue to dump
+     * @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
      */
-    public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array())
+    public function write(MessageCatalogue $catalogue, $format, $options = array())
     {
         if (!isset($this->dumpers[$format])) {
             throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format));
@@ -88,4 +83,21 @@ class TranslationWriter
         // save
         $dumper->dump($catalogue, $options);
     }
+
+    /**
+     * 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
+     *
+     * @deprecated since 3.4 will be removed in 4.0. Use write instead.
+     */
+    public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array())
+    {
+        @trigger_error(sprintf('Method %s() is deprecated since Symfony 3.4 and will be removed in 4.0. Use write() instead.', __METHOD__), E_USER_DEPRECATED);
+        $this->write($catalogue, $format, $options);
+    }
 }