Skip to content

Commit 2991639

Browse files
committed
[TwigBridge] Symfony 3.1 forward compatibility
1 parent 55b71eb commit 2991639

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)