[TwigBridge] Symfony 3.1 forward compatibility

This commit is contained in:
Christian Flothmann 2016-02-12 17:33:32 +01:00
parent 55b71ebd93
commit 29916394f8
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
namespace Symfony\Bridge\Twig\Extension;
use Symfony\Component\Yaml\Dumper as YamlDumper;
use Symfony\Component\Yaml\Yaml;
/**
* Provides integration of the Yaml component with Twig.
@ -40,7 +41,7 @@ class YamlExtension extends \Twig_Extension
}
if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
$dumpObjects = (int) $dumpObjects;
return $dumper->dump($input, $inline, 0, is_bool($dumpObjects) ? Yaml::DUMP_OBJECT : 0);
}
return $dumper->dump($input, $inline, 0, false, $dumpObjects);