Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9104fd4

Browse filesBrowse files
committed
[Config] YamlReferenceDumper: No default value required for VariableNode with array example
1 parent 21ef411 commit 9104fd4
Copy full SHA for 9104fd4

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\Config\Definition\NodeInterface;
1818
use Symfony\Component\Config\Definition\PrototypedArrayNode;
1919
use Symfony\Component\Config\Definition\ScalarNode;
20+
use Symfony\Component\Config\Definition\VariableNode;
2021
use Symfony\Component\Yaml\Inline;
2122

2223
/**
@@ -95,6 +96,9 @@ private function writeNode(NodeInterface $node, NodeInterface $parentNode = null
9596
} elseif ($node instanceof EnumNode) {
9697
$comments[] = 'One of '.implode('; ', array_map('json_encode', $node->getValues()));
9798
$default = $node->hasDefaultValue() ? Inline::dump($node->getDefaultValue()) : '~';
99+
} elseif (VariableNode::class === get_class($node) && \is_array($example)) {
100+
// If there is an array example, we are sure we dont need to print a default value
101+
$default = '';
98102
} else {
99103
$default = '~';
100104

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.