diff vendor/symfony/translation/DataCollectorTranslator.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children af1871eacc83
line wrap: on
line diff
--- a/vendor/symfony/translation/DataCollectorTranslator.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/translation/DataCollectorTranslator.php	Thu Feb 28 13:21:36 2019 +0000
@@ -27,7 +27,7 @@
      */
     private $translator;
 
-    private $messages = array();
+    private $messages = [];
 
     /**
      * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface
@@ -35,7 +35,7 @@
     public function __construct(TranslatorInterface $translator)
     {
         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;
@@ -44,7 +44,7 @@
     /**
      * {@inheritdoc}
      */
-    public function trans($id, array $parameters = array(), $domain = null, $locale = null)
+    public function trans($id, array $parameters = [], $domain = null, $locale = null)
     {
         $trans = $this->translator->trans($id, $parameters, $domain, $locale);
         $this->collectMessage($locale, $domain, $id, $trans, $parameters);
@@ -55,7 +55,7 @@
     /**
      * {@inheritdoc}
      */
-    public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
+    public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null)
     {
         $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
         $this->collectMessage($locale, $domain, $id, $trans, $parameters, $number);
@@ -90,7 +90,7 @@
     /**
      * Gets the fallback locales.
      *
-     * @return array $locales The fallback locales
+     * @return array The fallback locales
      */
     public function getFallbackLocales()
     {
@@ -98,7 +98,7 @@
             return $this->translator->getFallbackLocales();
         }
 
-        return array();
+        return [];
     }
 
     /**
@@ -106,7 +106,7 @@
      */
     public function __call($method, $args)
     {
-        return call_user_func_array(array($this->translator, $method), $args);
+        return \call_user_func_array([$this->translator, $method], $args);
     }
 
     /**
@@ -125,7 +125,7 @@
      * @param array|null  $parameters
      * @param int|null    $number
      */
-    private function collectMessage($locale, $domain, $id, $translation, $parameters = array(), $number = null)
+    private function collectMessage($locale, $domain, $id, $translation, $parameters = [], $number = null)
     {
         if (null === $domain) {
             $domain = 'messages';
@@ -152,7 +152,7 @@
             $state = self::MESSAGE_MISSING;
         }
 
-        $this->messages[] = array(
+        $this->messages[] = [
             'locale' => $locale,
             'domain' => $domain,
             'id' => $id,
@@ -160,6 +160,6 @@
             'parameters' => $parameters,
             'transChoiceNumber' => $number,
             'state' => $state,
-        );
+        ];
     }
 }