Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / translation / LoggingTranslator.php
index b259df5e0aa49d394950c486e6b894b06e5d06b5..194e554ad9106a33e50beb3cb32ff33b2386abb7 100644 (file)
@@ -12,6 +12,7 @@
 namespace Symfony\Component\Translation;
 
 use Psr\Log\LoggerInterface;
+use Symfony\Component\Translation\Exception\InvalidArgumentException;
 
 /**
  * @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
@@ -35,7 +36,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
     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)));
+            throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
         }
 
         $this->translator = $translator;
@@ -95,7 +96,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
      */
     public function getFallbackLocales()
     {
-        if ($this->translator instanceof Translator) {
+        if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) {
             return $this->translator->getFallbackLocales();
         }