diff vendor/symfony/css-selector/XPath/Extension/FunctionExtension.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/css-selector/XPath/Extension/FunctionExtension.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php	Thu Feb 28 13:21:36 2019 +0000
@@ -35,14 +35,14 @@
      */
     public function getFunctionTranslators()
     {
-        return array(
-            'nth-child' => array($this, 'translateNthChild'),
-            'nth-last-child' => array($this, 'translateNthLastChild'),
-            'nth-of-type' => array($this, 'translateNthOfType'),
-            'nth-last-of-type' => array($this, 'translateNthLastOfType'),
-            'contains' => array($this, 'translateContains'),
-            'lang' => array($this, 'translateLang'),
-        );
+        return [
+            'nth-child' => [$this, 'translateNthChild'],
+            'nth-last-child' => [$this, 'translateNthLastChild'],
+            'nth-of-type' => [$this, 'translateNthOfType'],
+            'nth-last-of-type' => [$this, 'translateNthLastOfType'],
+            'contains' => [$this, 'translateContains'],
+            'lang' => [$this, 'translateLang'],
+        ];
     }
 
     /**
@@ -93,7 +93,7 @@
             $expr .= ' - '.$b;
         }
 
-        $conditions = array(sprintf('%s %s 0', $expr, $sign));
+        $conditions = [sprintf('%s %s 0', $expr, $sign)];
 
         if (1 !== $a && -1 !== $a) {
             $conditions[] = sprintf('(%s) mod %d = 0', $expr, $a);
@@ -150,10 +150,7 @@
         $arguments = $function->getArguments();
         foreach ($arguments as $token) {
             if (!($token->isString() || $token->isIdentifier())) {
-                throw new ExpressionErrorException(
-                    'Expected a single string or identifier for :contains(), got '
-                    .implode(', ', $arguments)
-                );
+                throw new ExpressionErrorException('Expected a single string or identifier for :contains(), got '.implode(', ', $arguments));
             }
         }
 
@@ -173,10 +170,7 @@
         $arguments = $function->getArguments();
         foreach ($arguments as $token) {
             if (!($token->isString() || $token->isIdentifier())) {
-                throw new ExpressionErrorException(
-                    'Expected a single string or identifier for :lang(), got '
-                    .implode(', ', $arguments)
-                );
+                throw new ExpressionErrorException('Expected a single string or identifier for :lang(), got '.implode(', ', $arguments));
             }
         }