Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / config / Definition / Dumper / YamlReferenceDumper.php
index 5a0e76c5255a382b5265684a156b36aa92c8d5c0..fc5d20a2e70408d1423bd439b4adfcddf9f8f610 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;
 use Symfony\Component\Config\Definition\ScalarNode;
 use Symfony\Component\Yaml\Inline;
@@ -92,9 +92,9 @@ class YamlReferenceDumper
             }
 
             if (!$children) {
-                if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) {
+                if ($node->hasDefaultValue() && \count($defaultArray = $node->getDefaultValue())) {
                     $default = '';
-                } elseif (!is_array($example)) {
+                } elseif (!\is_array($example)) {
                     $default = '[]';
                 }
             }
@@ -107,10 +107,10 @@ class YamlReferenceDumper
             if ($node->hasDefaultValue()) {
                 $default = $node->getDefaultValue();
 
-                if (is_array($default)) {
-                    if (count($defaultArray = $node->getDefaultValue())) {
+                if (\is_array($default)) {
+                    if (\count($defaultArray = $node->getDefaultValue())) {
                         $default = '';
-                    } elseif (!is_array($example)) {
+                    } elseif (!\is_array($example)) {
                         $default = '[]';
                     }
                 } else {
@@ -130,12 +130,12 @@ class YamlReferenceDumper
         }
 
         // example
-        if ($example && !is_array($example)) {
+        if ($example && !\is_array($example)) {
             $comments[] = 'Example: '.$example;
         }
 
         $default = '' != (string) $default ? ' '.$default : '';
-        $comments = count($comments) ? '# '.implode(', ', $comments) : '';
+        $comments = \count($comments) ? '# '.implode(', ', $comments) : '';
 
         $key = $prototypedArray ? '-' : $node->getName().':';
         $text = rtrim(sprintf('%-21s%s %s', $key, $default, $comments), ' ');
@@ -153,17 +153,17 @@ class YamlReferenceDumper
         if ($defaultArray) {
             $this->writeLine('');
 
-            $message = count($defaultArray) > 1 ? 'Defaults' : 'Default';
+            $message = \count($defaultArray) > 1 ? 'Defaults' : 'Default';
 
             $this->writeLine('# '.$message.':', $depth * 4 + 4);
 
             $this->writeArray($defaultArray, $depth + 1);
         }
 
-        if (is_array($example)) {
+        if (\is_array($example)) {
             $this->writeLine('');
 
-            $message = count($example) > 1 ? 'Examples' : 'Example';
+            $message = \count($example) > 1 ? 'Examples' : 'Example';
 
             $this->writeLine('# '.$message.':', $depth * 4 + 4);
 
@@ -185,7 +185,7 @@ class YamlReferenceDumper
      */
     private function writeLine($text, $indent = 0)
     {
-        $indent = strlen($text) + $indent;
+        $indent = \strlen($text) + $indent;
         $format = '%'.$indent.'s';
 
         $this->reference .= sprintf($format, $text)."\n";
@@ -196,7 +196,7 @@ class YamlReferenceDumper
         $isIndexed = array_values($array) === $array;
 
         foreach ($array as $key => $value) {
-            if (is_array($value)) {
+            if (\is_array($value)) {
                 $val = '';
             } else {
                 $val = $value;
@@ -208,7 +208,7 @@ class YamlReferenceDumper
                 $this->writeLine(sprintf('%-20s %s', $key.':', $val), $depth * 4);
             }
 
-            if (is_array($value)) {
+            if (\is_array($value)) {
                 $this->writeArray($value, $depth + 1);
             }
         }