8000 merged branch bamarni/patch-10 (PR #5783) · sensi/symfony@94f5f49 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94f5f49

Browse files
committed
merged branch bamarni/patch-10 (PR symfony#5783)
This PR was merged into the 2.1 branch. Commits ------- 3553276 [ConfigDumpReference] avoid notice for variable nodes Discussion ---------- [ConfigDumpReference] avoid notice for variable nodes When a variable node has an array as default value, a notice occurs later on because of an "array to string conversion", which is turned to an exception in debug mode (mandatory in order to run this command).
2 parents 562d351 + 3553276 commit 94f5f49

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ private function outputNode(NodeInterface $node, $depth = 0)
213213
$default = 'false';
214214
} elseif (null === $default) {
215215
$default = '~';
216+
} elseif (is_array($default)) {
217+
if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) {
218+
$default = '';
219+
} elseif (!is_array($example)) {
220+
$default = '[]';
221+
}
216222
}
217223
}
218224
}

0 commit comments

Comments
 (0)
0