From 685a9b9d9adff18befeafffdc525e87c5034e29b Mon Sep 17 00:00:00 2001 From: Maxime STEINHAUSSER Date: Thu, 8 Dec 2016 11:30:28 +0100 Subject: [PATCH 1/3] [Config] Fix YamlReferenceDumper extra space --- .../Component/Config/Definition/Dumper/YamlReferenceDumper.php | 2 +- .../Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php | 1 + .../Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php | 1 + .../Tests/Fixtures/Configuration/ExampleConfiguration.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php index f9da698e09..12ababe394 100644 --- a/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php @@ -120,7 +120,7 @@ class YamlReferenceDumper $default = (string) $default != '' ? ' '.$default : ''; $comments = count($comments) ? '# '.implode(', ', $comments) : ''; - $text = rtrim(sprintf('%-20s %s %s', $node->getName().':', $default, $comments), ' '); + $text = rtrim(sprintf('%-21s%s %s', $node->getName().':', $default, $comments), ' '); if ($info = $node->getInfo()) { $this->writeLine(''); diff --git a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php index 42207b0399..2c0551d062 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php @@ -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="" > diff --git a/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php index 131ca072fe..ad1daddd7e 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php @@ -43,6 +43,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" diff --git a/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php b/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php index 68aa0c0593..1573177f44 100644 --- a/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php +++ b/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php @@ -34,6 +34,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') From 1ed9335e88ed543e8ab9104c3c2f4a5370d716a2 Mon Sep 17 00:00:00 2001 From: Maxime STEINHAUSSER Date: Thu, 8 Dec 2016 11:59:24 +0100 Subject: [PATCH 2/3] [Config] Do not skip YamlReferenceDumperTest entirely --- .../Tests/Definition/Dumper/YamlReferenceDumperTest.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php index 131ca072fe..21cce575e3 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php @@ -22,8 +22,8 @@ class YamlReferenceDumperTest extends \PHPUnit_Framework_TestCase $dumper = new YamlReferenceDumper(); + $this->assertContains($this->getConfigurationAsString(), $dumper->dump($configuration)); $this->markTestIncomplete('The Yaml Dumper currently does not support prototyped arrays'); - $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration)); } private function getConfigurationAsString() @@ -32,7 +32,7 @@ class YamlReferenceDumperTest extends \PHPUnit_Framework_TestCase acme_root: boolean: true scalar_empty: ~ - scalar_null: ~ + scalar_null: null scalar_true: true scalar_false: false scalar_default: default @@ -59,10 +59,6 @@ acme_root: # Prototype name: ~ - connections: - # Prototype - - { user: ~, pass: ~ } - EOL; } } From 91689a7961435400e6b1db3bc5bf35c8aa48e895 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 9 Dec 2016 07:11:54 +0100 Subject: [PATCH 3/3] add dependency on Twig Requiring a specific minimum version of the TwigBridge just to be sure that we end up with the required Twig version does not make much sense if can simply specify the required version instead (we do in fact depend on Twig in the WebProfilerBundle). --- src/Symfony/Bundle/WebProfilerBundle/composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/composer.json b/src/Symfony/Bundle/WebProfilerBundle/composer.json index a1de9a771b..8867a64eca 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/composer.json +++ b/src/Symfony/Bundle/WebProfilerBundle/composer.json @@ -19,7 +19,8 @@ "php": ">=5.3.9", "symfony/http-kernel": "~2.4", "symfony/routing": "~2.2", - "symfony/twig-bridge": "~2.7" + "symfony/twig-bridge": "~2.7", + "twig/twig": "~1.28|~2.0" }, "require-dev": { "symfony/config": "~2.2",