🔧
This commit is contained in:
8
vendor/symfony/translation/Translator.php
vendored
8
vendor/symfony/translation/Translator.php
vendored
@@ -69,7 +69,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
|
||||
/**
|
||||
* @throws InvalidArgumentException If a locale contains invalid characters
|
||||
*/
|
||||
public function __construct(string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = [])
|
||||
public function __construct(string $locale, ?MessageFormatterInterface $formatter = null, ?string $cacheDir = null, bool $debug = false, array $cacheVary = [])
|
||||
{
|
||||
$this->setLocale($locale);
|
||||
|
||||
@@ -110,7 +110,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
|
||||
*
|
||||
* @throws InvalidArgumentException If the locale contains invalid characters
|
||||
*/
|
||||
public function addResource(string $format, mixed $resource, string $locale, string $domain = null)
|
||||
public function addResource(string $format, mixed $resource, string $locale, ?string $domain = null)
|
||||
{
|
||||
$domain ??= 'messages';
|
||||
|
||||
@@ -171,7 +171,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
|
||||
return $this->fallbackLocales;
|
||||
}
|
||||
|
||||
public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string
|
||||
public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string
|
||||
{
|
||||
if (null === $id || '' === $id) {
|
||||
return '';
|
||||
@@ -203,7 +203,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
|
||||
return $this->formatter->format($catalogue->get($id, $domain), $locale, $parameters);
|
||||
}
|
||||
|
||||
public function getCatalogue(string $locale = null): MessageCatalogueInterface
|
||||
public function getCatalogue(?string $locale = null): MessageCatalogueInterface
|
||||
{
|
||||
if (!$locale) {
|
||||
$locale = $this->getLocale();
|
||||
|
||||
Reference in New Issue
Block a user