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

Skip to content

Yaml dump - missing new line after TaggedValue #33354

Closed
@Selion05

Description

@Selion05

Symfony version(s) affected: x.y.z
symfony/yaml v4.3.4 Symfony Yaml Component

Description
If you dump an array with a high inline value an new line is missing after TaggedValue

How to reproduce

<?php

require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Yaml\Yaml;

$yaml = <<<YAML
services:
    service.id:
        arguments: [!tagged my.tag]
    service.id.2:
YAML;

$services = Yaml::parse($yaml, Yaml::PARSE_CUSTOM_TAGS);

$dumped = Yaml::dump($services, 8);

echo  $dumped;

results in

services:
    service.id:
        arguments:
            - !tagged
              my.tag    service.id.2: null

Possible Solution
Add a new line here

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