You are here

public function DataCollectorTranslator::__construct in Zircon Profile 8

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

Parameters

TranslatorInterface $translator The translator must implement TranslatorBagInterface:

File

vendor/symfony/translation/DataCollectorTranslator.php, line 36

Class

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

Namespace

Symfony\Component\Translation

Code

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