Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -23,35 +23,19 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class TranslationWriter implements TranslationWriterInterface
{
/**
* @var array<string, DumperInterface>
*/
private $dumpers = [];
/**
* Adds a dumper to the writer.
*
* @param string $format The format of the dumper
* @param DumperInterface $dumper The dumper
*/
public function addDumper($format, DumperInterface $dumper)
public function addDumper(string $format, DumperInterface $dumper)
{
$this->dumpers[$format] = $dumper;
}
/**
* 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);
}
}
}
/**
* Obtains the list of supported formats.
*
@@ -65,13 +49,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 = [])
public function write(MessageCatalogue $catalogue, string $format, array $options = [])
{
if (!isset($this->dumpers[$format])) {
throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format));
@@ -81,7 +64,7 @@ class TranslationWriter implements TranslationWriterInterface
$dumper = $this->dumpers[$format];
if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) {
throw new RuntimeException(sprintf('Translation Writer was not able to create directory "%s"', $options['path']));
throw new RuntimeException(sprintf('Translation Writer was not able to create directory "%s".', $options['path']));
}
// save