Merge branch '3.1' into 3.2

* 3.1:
  add dependency on Twig
  [Config] Do not skip YamlReferenceDumperTest entirely
  [Config] Fix YamlReferenceDumper extra space
This commit is contained in:
Fabien Potencier 2016-12-09 08:45:17 +01:00
commit c41904164c
5 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,7 @@
"symfony/polyfill-php70": "~1.0",
"symfony/routing": "~2.8|~3.0",
"symfony/twig-bridge": "~2.8|~3.0",
"twig/twig": "~1.28|~2.0",
"symfony/var-dumper": "~3.2"
},
"require-dev": {

View File

@ -106,7 +106,7 @@ class YamlReferenceDumper
$comments = count($comments) ? '# '.implode(', ', $comments) : '';
$key = $prototypedArray ? '-' : $node->getName().':';
$text = rtrim(sprintf('%-20s %s %s', $key, $default, $comments), ' ');
$text = rtrim(sprintf('%-21s%s %s', $key, $default, $comments), ' ');
if ($info = $node->getInfo()) {
$this->writeLine('');

View File

@ -49,6 +49,7 @@ class XmlReferenceDumperTest extends \PHPUnit_Framework_TestCase
scalar-array-empty=""
scalar-array-defaults="elem1,elem2"
scalar-required=""
node-with-a-looong-name=""
enum-with-default="this"
enum=""
>

View File

@ -42,6 +42,7 @@ acme_root:
- elem1
- elem2
scalar_required: ~ # Required
node_with_a_looong_name: ~
enum_with_default: this # One of "this"; "that"
enum: ~ # One of "this"; "that"

View File

@ -35,6 +35,7 @@ class ExampleConfiguration implements ConfigurationInterface
->scalarNode('scalar_array_empty')->defaultValue(array())->end()
->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end()
->scalarNode('scalar_required')->isRequired()->end()
->scalarNode('node_with_a_looong_name')->end()
->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end()
->enumNode('enum')->values(array('this', 'that'))->end()
->arrayNode('array')