Skip to content

Commit 1fc6a54

Browse files
committed
feature symfony#17705 [TwigBridge] deprecate the boolean object support trigger (xabbuh)
This PR was merged into the 3.1-dev branch. Discussion ---------- [TwigBridge] deprecate the boolean object support trigger | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This reflects the changes done in the Yaml component in symfony#17578. Commits ------- 27243c6 deprecate the boolean object support trigger
2 parents 61575e7 + 27243c6 commit 1fc6a54

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
@@ -39,7 +39,8 @@ public function encode($input, $inline = 0, $dumpObjects = false)
3939
$dumper = new YamlDumper();
4040
}
4141

42-
if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT')) {
42+
if (defined('Symfony\Component\Yaml\Yaml::DUMP_OBJECT') && is_bool($dumpObjects)) {
43+
@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);
4344
$dumpObjects = (int) $dumpObjects;
4445
}
4546

0 commit comments

Comments
 (0)