8000 minor #20826 [Config] Fix YamlReferenceDumper extra space (ogizanagi) · symfony/symfony@42929dd · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 42929dd

Browse files
committed
minor #20826 [Config] Fix YamlReferenceDumper extra space (ogizanagi)
This PR was merged into the 2.7 branch. Discussion ---------- [Config] Fix YamlReferenceDumper extra space | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes (minor rendering issue) | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Simply fixes a minor rendering issue when using the `YamlReferenceDumper`. <details> <summary>For reference, see the difference with this fix on the framework configuration</summary> ```diff diff --git a/framework_before.yml b/framework_after.yml index f28ffd0..0486709 100644 --- a/framework1.txt +++ b/framework2.txt @@ -3,7 +3,7 @@ framework: secret: ~ # Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. Note: When using the HttpCache, you need to call the method in your front controller instead - http_method_override: true + http_method_override: true trusted_proxies: [] ide: null test: ~ @@ -37,7 +37,7 @@ framework: enabled: false collect: true only_exceptions: false - only_master_requests: false + only_master_requests: false dsn: 'file:%kernel.cache_dir%/profiler' matcher: enabled: false @@ -97,7 +97,7 @@ framework: save_path: '%kernel.cache_dir%/sessions' # seconds to wait between 2 session metadata updates, it will also prevent the session handler to write if the session has not changed - metadata_update_threshold: '0' + metadata_update_threshold: '0' # request configuration request: @@ -110,7 +110,7 @@ framework: # templating configuration templating: enabled: false - hinclude_default_template: null + hinclude_default_template: null cache: ~ form: resources: @@ -180,7 +180,7 @@ framework: # Property access configuration property_access: magic_call: false - throw_exception_on_invalid_index: false + throw_exception_on_invalid_index: false # Property info configuration property_info: @@ -198,9 +198,9 @@ framework: # System related cache pools configuration system: cache.adapter.system directory: '%kernel.cache_dir%/pools' - default_doctrine_provider: ~ - default_psr6_provider: ~ - default_redis_provider: 'redis://localhost' + default_doctrine_provider: ~ + default_psr6_provider: ~ + default_redis_provider: 'redis://localhost' pools: # Prototype ``` </details> --- (tests failures are unrelated) Commits ------- 685a9b9 [Config] Fix YamlReferenceDumper extra space
2 parents d9738a4 + 685a9b9 commit 42929dd

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function writeNode(NodeInterface $node, $depth = 0)
120120
$default = (string) $default != '' ? ' '.$default : '';
121121
$comments = count($comments) ? '# '.implode(', ', $comments) : '';
122122

123-
$text = rtrim(sprintf('%-20s %s %s', $node->getName().':', $default, $comments), ' ');
123+
$text = rtrim(sprintf('%-21s%s %s', $node->getName().':', $default, $comments), ' ');
124124

125125
if ($info = $node->getInfo()) {
126126
$this->writeLine('');

src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ private function getConfigurationAsString()
4949
scalar-array-empty=""
5050
scalar-array-defaults="elem1,elem2"
5151
scalar-required=""
52+
node-with-a-looong-name=""
5253
enum-with-default="this"
5354
enum=""
5455
>

src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ private function getConfigurationAsString()
4343
- elem1
4444
- elem2
4545
scalar_required: ~ # Required
46+
node_with_a_looong_name: ~
4647
enum_with_default: this # One of "this"; "that"
4748
enum: ~ # One of "this"; "that"
4849

src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function getConfigTreeBuilder()
3434
->scalarNode('scalar_array_empty')->defaultValue(array())->end()
3535
->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end()
3636
->scalarNode('scalar_required')->isRequired()->end()
37+
->scalarNode('node_with_a_looong_name')->end()
3738
->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end()
3839
->enumNode('enum')->values(array('this', 'that'))->end()
3940
->arrayNode('array')

0 commit comments

Comments
 (0)
0