Skip to content

Commit 3ef0425

Browse files
Merge branch '4.3' into 4.4
* 4.3: [Routing] fix static route reordering when a previous dynamic route conflicts Return null as Expire header if it was set to null bug #33370 Fix import statement typo in NullCache (adrienbrault) [ProxyManager] remove ProxiedMethodReturnExpression polyfill fix dumping not inlined scalar tag values
2 parents dfa2c49 + 9973789 commit 3ef0425

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Dumper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0):
8585
} else {
8686
$output .= "\n";
8787
$output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags);
88+
89+
if (is_scalar($value->getValue())) {
90+
$output .= "\n";
91+
}
8892
}
8993

9094
continue;

Tests/DumperTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,23 @@ public function testDumpingTaggedValueMapWithInlinedTagValues()
459459
$this->assertSame($expected, $yaml);
460460
}
461461

462+
public function testDumpingNotInlinedScalarTaggedValue()
463+
{
464+
$data = [
465+
'user1' => new TaggedValue('user', 'jane'),
466+
'user2' => new TaggedValue('user', 'john'),
467+
];
468+
$expected = <<<YAML
469+
user1: !user
470+
jane
471+
user2: !user
472+
john
473+
474+
YAML;
475+
476+
$this->assertSame($expected, $this->dumper->dump($data, 2));
477+
}
478+
462479
public function testDumpMultiLineStringAsScalarBlock()
463480
{
464481
$data = [

0 commit comments

Comments
 (0)