Closed
Description
Symfony version(s) affected: Tested on 5.x
Description
Anchors are parsed correctly when not used inline, but ignored when they are. The test below highlights the problem.
How to reproduce
public function testInlineReferences()
{
$this->assertEquals([
'foo' => ['bar' => 'baz'],
'bar' => ['foo' => 'baz']
], Yaml::parse(<<<'EOF'
foo: { bar: &baz baz }
bar: { foo: *baz }
EOF
));
}
Possible Solution
References are passed by value to the Inline parser, which may be a BC break if changed. There is no handling whatsoever for anchors, which requires significant changes to the inline parser that I don't feel comfortable doing (for lack of experience with it).