You are here

public function LoggingTranslator::__construct in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/LoggingTranslator.php \Symfony\Component\Translation\LoggingTranslator::__construct()

Parameters

TranslatorInterface $translator The translator must implement TranslatorBagInterface:

LoggerInterface $logger:

File

vendor/symfony/translation/LoggingTranslator.php, line 35

Class

LoggingTranslator
@author Abdellatif Ait boudad <a.aitboudad@gmail.com>

Namespace

Symfony\Component\Translation

Code

public function __construct(TranslatorInterface $translator, LoggerInterface $logger) {
  if (!$translator instanceof TranslatorBagInterface) {
    throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
  }
  $this->translator = $translator;
  $this->logger = $logger;
}