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

Skip to content

Commit a966a88

Browse files
committed
minor #17780 [TwigBridge] Symfony 3.1 forward compatibility (xabbuh)
This PR was merged into the 2.3 branch. Discussion ---------- [TwigBridge] Symfony 3.1 forward compatibility | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17743 (comment) | License | MIT | Doc PR | Commits ------- 2991639 [TwigBridge] Symfony 3.1 forward compatibility
2 parents 1229b6d + 2991639 commit a966a88

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Bridge/Twig/Extension/YamlExtension.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\Twig\Extension;
1313

1414
use Symfony\Component\Yaml\Dumper as YamlDumper;
15+
use Symfony\Component\Yaml\Yaml;
1516

1617
/**
1718
* Provides integration of the Yaml component with Twig.
@@ -40,7 +41,7 @@ public function encode($input, $inline = 0, $dumpObjects = false)
4041
}
4142

4243
if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
43-
$dumpObjects = (int) $dumpObjects;
44+
return $dumper->dump($input, $inline, 0, is_bool($dumpObjects) ? Yaml::DUMP_OBJECT : 0);
4445
}
4546

4647
return $dumper->dump($input, $inline, 0, false, $dumpObjects);

0 commit comments

Comments
 (0)