Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug of end of line using Yaml::dump #33464

Closed
@abonne01

Description

@abonne01

Symfony version(s) affected: 4.3.4
Description
Following correction of bug #32251 (thanks @nicolas-grekas) there is a problem with yaml::dump function when using Tagged value and inline parameter

How to reproduce

    $rootYaml[] = new TaggedValue('group', 'admin');
    $rootYaml[] = new TaggedValue('group', 'admin2');
    $admin = array(
        'role' => new TaggedValue('group', 'admin'),
        'privileges' => array('read', 'create', 'update'),
        'resource' => new TaggedValue('policy', 'root')
    );
    $rootYaml[] = new TaggedValue('permit', $admin);

    $value = Yaml::dump($rootYaml, 3);
    print_r($value);
    

result

- !group
  admin- !group
  admin2- !permit
  role: !group
      admin  privileges:
      - read
      - create
      - update
  resource: !policy
      root

expected result

- !group admin
- !group admin2
- !permit
  role: !group admin  
  privileges:
      - read
      - create
      - update
  resource: !policy root

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions