Skip to content
Permalink
Browse files

bug #20341 Fix YamlReferenceDumper unnamed nested prototypes (ogizanagi)

This PR was squashed before being merged into the 3.2-dev branch (closes #20341).

Discussion
----------

Fix YamlReferenceDumper unnamed nested prototypes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20340
| License       | MIT
| Doc PR        | N/A

Ideally, I'd like to output something like:

```yml
pipou:

    # Prototype
    name:

        # Prototype
        -
            didou:                ~
```

But for now, this should fix the regression.

Commits
-------

8e04643 Fix YamlReferenceDumper unnamed nested prototypes
  • Loading branch information...
fabpot committed Oct 28, 2016
2 parents 700c04b + 8e04643 commit 46a8edea8d473e82ab8ac9a82294df047ba5f962
@@ -201,7 +201,7 @@ private function getPrototypeChildren(PrototypedArrayNode $node)
$keyNode = new ArrayNode($key, $node);
$children = $prototype->getChildren();
if ($prototype instanceof PrototypedArrayNode) {
if ($prototype instanceof PrototypedArrayNode && $prototype->getKeyAttribute()) {
$children = $this->getPrototypeChildren($prototype);
}
@@ -92,6 +92,14 @@ private function getConfigurationAsString()
</cms-page>
<!-- prototype -->
<pipou name="pipou name">
<!-- prototype -->
<name didou="" />
</pipou>
</config>
EOL
@@ -74,6 +74,10 @@ private function getConfigurationAsString()
locale:
title: ~ # Required
path: ~ # Required
pipou:
# Prototype
name: []
EOL;
}
@@ -80,6 +80,17 @@ public function getConfigTreeBuilder()
->end()
->end()
->end()
->arrayNode('pipou')
->useAttributeAsKey('name')
->prototype('array')
->prototype('array')
->children()
->scalarNode('didou')
->end()
->end()
->end()
->end()
->end()
->end()
;

0 comments on commit 46a8ede

Please sign in to comment.
You can’t perform that action at this time.