diff vendor/symfony/translation/Extractor/PhpStringTokenParser.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
line wrap: on
line diff
--- a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/translation/Extractor/PhpStringTokenParser.php	Thu Feb 28 13:21:36 2019 +0000
@@ -49,7 +49,7 @@
 
 class PhpStringTokenParser
 {
-    protected static $replacements = array(
+    protected static $replacements = [
         '\\' => '\\',
         '$' => '$',
         'n' => "\n",
@@ -58,7 +58,7 @@
         'f' => "\f",
         'v' => "\v",
         'e' => "\x1B",
-    );
+    ];
 
     /**
      * Parses a string token.
@@ -76,8 +76,8 @@
 
         if ('\'' === $str[$bLength]) {
             return str_replace(
-                array('\\\\', '\\\''),
-                array('\\', '\''),
+                ['\\\\', '\\\''],
+                ['\\', '\''],
                 substr($str, $bLength + 1, -1)
             );
         } else {
@@ -89,7 +89,7 @@
      * Parses escape sequences in strings (all string types apart from single quoted).
      *
      * @param string      $str   String without quotes
-     * @param null|string $quote Quote type
+     * @param string|null $quote Quote type
      *
      * @return string String with escape sequences parsed
      */
@@ -101,7 +101,7 @@
 
         return preg_replace_callback(
             '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3})~',
-            array(__CLASS__, 'parseCallback'),
+            [__CLASS__, 'parseCallback'],
             $str
         );
     }
@@ -113,9 +113,9 @@
         if (isset(self::$replacements[$str])) {
             return self::$replacements[$str];
         } elseif ('x' === $str[0] || 'X' === $str[0]) {
-            return chr(hexdec($str));
+            return \chr(hexdec($str));
         } else {
-            return chr(octdec($str));
+            return \chr(octdec($str));
         }
     }