Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / config / Definition / Dumper / XmlReferenceDumper.php
index f78bc7c3a258b28b42dd4df34fc13903157495a8..881457c923446ab1506765858316c35aedffec66 100644 (file)
 
 namespace Symfony\Component\Config\Definition\Dumper;
 
-use Symfony\Component\Config\Definition\ConfigurationInterface;
-use Symfony\Component\Config\Definition\NodeInterface;
 use Symfony\Component\Config\Definition\ArrayNode;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
 use Symfony\Component\Config\Definition\EnumNode;
+use Symfony\Component\Config\Definition\NodeInterface;
 use Symfony\Component\Config\Definition\PrototypedArrayNode;
 
 /**
@@ -58,7 +58,7 @@ class XmlReferenceDumper
                 return $rootName === $mapping[1];
             });
 
-            if (count($remapping)) {
+            if (\count($remapping)) {
                 list($singular) = current($remapping);
                 $rootName = $singular;
             }
@@ -105,7 +105,7 @@ class XmlReferenceDumper
                     if ($prototype->hasDefaultValue()) {
                         $prototypeValue = $prototype->getDefaultValue();
                     } else {
-                        switch (get_class($prototype)) {
+                        switch (\get_class($prototype)) {
                             case 'Symfony\Component\Config\Definition\ScalarNode':
                                 $prototypeValue = 'scalar value';
                                 break;
@@ -161,7 +161,7 @@ class XmlReferenceDumper
                         $comments[] = 'One of '.implode('; ', array_map('json_encode', $child->getValues()));
                     }
 
-                    if (count($comments)) {
+                    if (\count($comments)) {
                         $rootAttributeComments[$name] = implode(";\n", $comments);
                     }
 
@@ -182,18 +182,18 @@ class XmlReferenceDumper
         // render comments
 
         // root node comment
-        if (count($rootComments)) {
+        if (\count($rootComments)) {
             foreach ($rootComments as $comment) {
                 $this->writeLine('<!-- '.$comment.' -->', $depth);
             }
         }
 
         // attribute comments
-        if (count($rootAttributeComments)) {
+        if (\count($rootAttributeComments)) {
             foreach ($rootAttributeComments as $attrName => $comment) {
-                $commentDepth = $depth + 4 + strlen($attrName) + 2;
+                $commentDepth = $depth + 4 + \strlen($attrName) + 2;
                 $commentLines = explode("\n", $comment);
-                $multiline = (count($commentLines) > 1);
+                $multiline = (\count($commentLines) > 1);
                 $comment = implode(PHP_EOL.str_repeat(' ', $commentDepth), $commentLines);
 
                 if ($multiline) {
@@ -208,9 +208,9 @@ class XmlReferenceDumper
 
         // render start tag + attributes
         $rootIsVariablePrototype = isset($prototypeValue);
-        $rootIsEmptyTag = (0 === count($rootChildren) && !$rootIsVariablePrototype);
+        $rootIsEmptyTag = (0 === \count($rootChildren) && !$rootIsVariablePrototype);
         $rootOpenTag = '<'.$rootName;
-        if (1 >= ($attributesCount = count($rootAttributes))) {
+        if (1 >= ($attributesCount = \count($rootAttributes))) {
             if (1 === $attributesCount) {
                 $rootOpenTag .= sprintf(' %s="%s"', current(array_keys($rootAttributes)), $this->writeValue(current($rootAttributes)));
             }
@@ -265,7 +265,7 @@ class XmlReferenceDumper
      */
     private function writeLine($text, $indent = 0)
     {
-        $indent = strlen($text) + $indent;
+        $indent = \strlen($text) + $indent;
         $format = '%'.$indent.'s';
 
         $this->reference .= sprintf($format, $text).PHP_EOL;
@@ -284,7 +284,7 @@ class XmlReferenceDumper
             return '';
         }
 
-        if (is_string($value) || is_numeric($value)) {
+        if (\is_string($value) || is_numeric($value)) {
             return $value;
         }
 
@@ -304,7 +304,7 @@ class XmlReferenceDumper
             return '';
         }
 
-        if (is_array($value)) {
+        if (\is_array($value)) {
             return implode(',', $value);
         }
     }