deprecate the boolean object support trigger

This commit is contained in:
Christian Flothmann 2016-02-05 17:55:36 +01:00
parent 15b00cc3f8
commit 27243c6b65

View File

@ -39,7 +39,8 @@ class YamlExtension extends \Twig_Extension
$dumper = new YamlDumper();
}
if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT') && is_bool($dumpObjects)) {
@trigger_error('Passing a boolean flag to toggle object support is deprecated since version 3.1 and will be removed in 4.0. Use the Yaml::DUMP_OBJECT flag instead.', E_USER_DEPRECATED);
$dumpObjects = (int) $dumpObjects;
}