updated-packages
This commit is contained in:
18
vendor/symfony/translation/Dumper/FileDumper.php
vendored
18
vendor/symfony/translation/Dumper/FileDumper.php
vendored
@@ -51,7 +51,7 @@ abstract class FileDumper implements DumperInterface
|
||||
*/
|
||||
public function setBackup($backup)
|
||||
{
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), \E_USER_DEPRECATED);
|
||||
|
||||
if (false !== $backup) {
|
||||
throw new \LogicException('The backup feature is no longer supported.');
|
||||
@@ -61,9 +61,9 @@ abstract class FileDumper implements DumperInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dump(MessageCatalogue $messages, $options = array())
|
||||
public function dump(MessageCatalogue $messages, $options = [])
|
||||
{
|
||||
if (!array_key_exists('path', $options)) {
|
||||
if (!\array_key_exists('path', $options)) {
|
||||
throw new InvalidArgumentException('The file dumper needs a path option.');
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ abstract class FileDumper implements DumperInterface
|
||||
$intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale());
|
||||
file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options));
|
||||
|
||||
$messages->replace(array(), $intlDomain);
|
||||
$messages->replace([], $intlDomain);
|
||||
|
||||
try {
|
||||
if ($messages->all($domain)) {
|
||||
@@ -103,13 +103,11 @@ abstract class FileDumper implements DumperInterface
|
||||
/**
|
||||
* Transforms a domain of a message catalogue to its string representation.
|
||||
*
|
||||
* @param MessageCatalogue $messages
|
||||
* @param string $domain
|
||||
* @param array $options
|
||||
* @param string $domain
|
||||
*
|
||||
* @return string representation
|
||||
*/
|
||||
abstract public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array());
|
||||
abstract public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []);
|
||||
|
||||
/**
|
||||
* Gets the file extension of the dumper.
|
||||
@@ -123,10 +121,10 @@ abstract class FileDumper implements DumperInterface
|
||||
*/
|
||||
private function getRelativePath(string $domain, string $locale): string
|
||||
{
|
||||
return strtr($this->relativePathTemplate, array(
|
||||
return strtr($this->relativePathTemplate, [
|
||||
'%domain%' => $domain,
|
||||
'%locale%' => $locale,
|
||||
'%extension%' => $this->getExtension(),
|
||||
));
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user