update2
This commit is contained in:
parent
98419bd18d
commit
8a69e45efa
4919 changed files with 28311 additions and 224136 deletions
30
pfosten/vendor/symfony/translation/Writer/TranslationWriter.php
vendored
Executable file → Normal file
30
pfosten/vendor/symfony/translation/Writer/TranslationWriter.php
vendored
Executable file → Normal file
|
|
@ -11,23 +11,18 @@
|
|||
|
||||
namespace Symfony\Component\Translation\Writer;
|
||||
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
use Symfony\Component\Translation\Dumper\DumperInterface;
|
||||
use Symfony\Component\Translation\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Translation\Exception\RuntimeException;
|
||||
use Symfony\Component\Translation\MessageCatalogue;
|
||||
|
||||
/**
|
||||
* TranslationWriter writes translation messages.
|
||||
*
|
||||
* @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('The "%s()" method 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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue