if (!
$translator instanceof TranslatorBagInterface || !
$translator instanceof LocaleAwareInterface
) { throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.',
get_debug_type($translator)));
} $this->translator =
$translator;
} public function trans(?string
$id, array
$parameters =
[], string
$domain = null, string
$locale = null
): string
{ $trans =
$this->translator->
trans($id =
(string) $id,
$parameters,
$domain,
$locale);
$this->
collectMessage($locale,
$domain,
$id,
$trans,
$parameters);
return $trans;
} /**
* @return void
*/
public function setLocale(string
$locale) { $this->translator->
setLocale($locale);
}