Skip to content

Commit 2e48a00

Browse files
Nyholmnicolas-grekas
authored andcommitted
Create an interface for TranslationWriter
1 parent 1c5a2b1 commit 2e48a00

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Symfony\Component\Console\Input\InputOption;
2222
use Symfony\Component\Translation\Extractor\ExtractorInterface;
2323
use Symfony\Component\Translation\MessageCatalogue;
24-
use Symfony\Component\Translation\Writer\TranslationWriter;
24+
use Symfony\Component\Translation\Writer\TranslationWriterInterface;
2525

2626
/**
2727
* A command that parses templates to extract translation messages and adds them
@@ -39,14 +39,14 @@ class TranslationUpdateCommand extends ContainerAwareCommand
3939
private $defaultLocale;
4040

4141
/**
42-
* @param TranslationWriter $writer
43-
* @param TranslationLoader $loader
44-
* @param ExtractorInterface $extractor
45-
* @param string $defaultLocale
42+
* @param TranslationWriterInterface $writer
43+
* @param TranslationLoader $loader
44+
* @param ExtractorInterface $extractor
45+
* @param string $defaultLocale
4646
*/
4747
public function __construct($writer = null, TranslationLoader $loader = null, ExtractorInterface $extractor = null, $defaultLocale = null)
4848
{
49-
if (!$writer instanceof TranslationWriter) {
49+
if (!$writer instanceof TranslationWriterInterface) {
5050
@trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
5151

5252
parent::__construct($writer);
@@ -276,7 +276,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
276276
$bundleTransPath = end($transPaths).'translations';
277277
}
278278

279-
$this->writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->defaultLocale));
279+
$this->writer->write($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->defaultLocale));
280280

281281
if (true === $input->getOption('dump-messages')) {
282282
$resultMessage .= ' and translation files were updated';

0 commit comments

Comments
 (0)