updated backend
This commit is contained in:
parent
1fea0f4fe7
commit
11521c2339
3459 changed files with 72735 additions and 168535 deletions
|
|
@ -23,13 +23,12 @@ use Symfony\Component\Translation\MessageCatalogue;
|
|||
*/
|
||||
class TranslationWriter implements TranslationWriterInterface
|
||||
{
|
||||
private $dumpers = array();
|
||||
private $dumpers = [];
|
||||
|
||||
/**
|
||||
* Adds a dumper to the writer.
|
||||
*
|
||||
* @param string $format The format of the dumper
|
||||
* @param DumperInterface $dumper The dumper
|
||||
* @param string $format The format of the dumper
|
||||
*/
|
||||
public function addDumper($format, DumperInterface $dumper)
|
||||
{
|
||||
|
|
@ -38,9 +37,13 @@ class TranslationWriter implements TranslationWriterInterface
|
|||
|
||||
/**
|
||||
* Disables dumper backup.
|
||||
*
|
||||
* @deprecated since Symfony 4.1
|
||||
*/
|
||||
public function disableBackup()
|
||||
{
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED);
|
||||
|
||||
foreach ($this->dumpers as $dumper) {
|
||||
if (method_exists($dumper, 'setBackup')) {
|
||||
$dumper->setBackup(false);
|
||||
|
|
@ -61,13 +64,12 @@ class TranslationWriter implements TranslationWriterInterface
|
|||
/**
|
||||
* 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
|
||||
* @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 write(MessageCatalogue $catalogue, $format, $options = array())
|
||||
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));
|
||||
|
|
@ -83,21 +85,4 @@ class TranslationWriter implements TranslationWriterInterface
|
|||
// 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