-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Open
Description
Description
I want the output of Yaml::dump to understand anchors and aliasses.
Suggested possibility:
$data = [
'key' => new \Symfony\Component\Yaml\Anchor\Anchor('anchor_name', [
'sub' => 'data',
'<<' => new Symfony\Component\Yaml\Anchor\Alias( 'anchor_name'),
]),
];key: &anchor_name
sub: 'data'
<<: *anchor_nameThis example is not complete, but just a simple example of the requested feature.
I'm happy to start a PR if you are interested in this feature (which I really would like to use).
An alternative approach would be to add a Literal/Raw class, which is just output-as-is, for both keys (not sure how to have an array key for this, yet) and values, which would allow developers to insert structures that actually are valid yaml, but cannot be used right now.
Example
No response
GromNaN