yaml icon indicating copy to clipboard operation
yaml copied to clipboard

Anchors with dash is not working

Open deadbead opened this issue 6 months ago • 0 comments

Hi!

Unfortunately valid YAML is not parsed as expected. Look at example below:

$yamlContent = <<<EOF
anchor_definition: &anchor-name OK

anchor_call: *anchor-name
EOF;

$obj = Yaml::parse($yamlContent);

print_r($obj->anchor_definition); //&anchor-name OK
print_r($obj->anchor_call); //*anchor-name
print_r($obj->getAllReferences()); //Array ( )
print_r($obj->getReference('anchor-name')); //UnexpectedValueException: no reference named: 'anchor-name', known are : () (0)

deadbead avatar Aug 27 '24 12:08 deadbead