merged branch bamarni/patch-10 (PR #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).
This commit is contained in:
Fabien Potencier 2012-10-24 17:35:37 +02:00
commit 94f5f49894

View File

@ -213,6 +213,12 @@ EOF
$default = 'false';
} elseif (null === $default) {
$default = '~';
} elseif (is_array($default)) {
if ($node->hasDefaultValue() && count($defaultArray = $node->getDefaultValue())) {
$default = '';
} elseif (!is_array($example)) {
$default = '[]';
}
}
}
}