-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: symfony/yaml 4.3
Description
I have an issue with Yaml::Dump() function.
when I use TaggedValue, dump function is ignoring parameter $inline
How to reproduce
$rootYaml = array();
foreach ($Admins as $Admin) {
$adm = array(
'id' => $Admin['samaccountname'][0],
'annotations' => array(
'name' => $Admin['cn'][0],
'email' => $Admin['mail'][0]
));
$rootYaml[] = new TaggedValue('user', $adm);
}
$value = Yaml::dump($rootYaml, 3);
I would expect to have
- !user
id: user1,
annotations:
name: 'Louisa Nicolas'
email: mail@domain.com
- !user
id: user2
annotations:
name: 'Telper Max'
email: mail@domain.com
but it's returning
- !user { id: user1, annotations: { name: 'Louisa Nicolas', email: mail@domain.com } }
- !user { id: user2, annotations: { name: 'Telper Max', email: mail@domain.com } }
Possible bug location
comming from Dumper.php, line 58 on if condition
if ($inline <= 0 || !\is_array($input) || empty($input)) {